Release v1.0.34
This commit is contained in:
@@ -30,35 +30,43 @@ jobs:
|
||||
run: |
|
||||
cd hello_gitea
|
||||
mkdir -p bin
|
||||
|
||||
echo "Building for all platforms..."
|
||||
# Build for all platforms
|
||||
echo "Building for linux amd64..."
|
||||
quick-build linux amd64
|
||||
echo "Building for linux arm64..."
|
||||
quick-build linux arm64
|
||||
echo "Building for windows amd64..."
|
||||
quick-build windows amd64
|
||||
echo "Building for darwin amd64..."
|
||||
quick-build darwin amd64
|
||||
echo "Building for darwin arm64..."
|
||||
quick-build darwin arm64
|
||||
|
||||
# Build for all platforms
|
||||
GOOS=linux GOARCH=amd64 go build -o bin/hello-api-linux-amd64 main.go
|
||||
GOOS=linux GOARCH=arm64 go build -o bin/hello-api-linux-arm64 main.go
|
||||
GOOS=windows GOARCH=amd64 go build -o bin/hello-api-windows-amd64.exe main.go
|
||||
GOOS=darwin GOARCH=amd64 go build -o bin/hello-api-darwin-amd64 main.go
|
||||
GOOS=darwin GOARCH=arm64 go build -o bin/hello-api-darwin-arm64 main.go
|
||||
# Build for all platforms - old variant
|
||||
# GOOS=linux GOARCH=amd64 go build -o bin/hello-api-linux-amd64 main.go
|
||||
# GOOS=linux GOARCH=arm64 go build -o bin/hello-api-linux-arm64 main.go
|
||||
# GOOS=windows GOARCH=amd64 go build -o bin/hello-api-windows-amd64.exe main.go
|
||||
# GOOS=darwin GOARCH=amd64 go build -o bin/hello-api-darwin-amd64 main.go
|
||||
# GOOS=darwin GOARCH=arm64 go build -o bin/hello-api-darwin-arm64 main.go
|
||||
|
||||
# Create archives
|
||||
echo "Creating archives..."
|
||||
cd bin
|
||||
tar -czf hello-api-linux-amd64.tar.gz hello-api-linux-amd64
|
||||
tar -czf hello-api-linux-arm64.tar.gz hello-api-linux-arm64
|
||||
tar -czf hello-api-windows-amd64.tar.gz hello-api-windows-amd64.exe
|
||||
tar -czf hello-api-darwin-amd64.tar.gz hello-api-darwin-amd64
|
||||
tar -czf hello-api-darwin-arm64.tar.gz hello-api-darwin-arm64
|
||||
|
||||
ls -la
|
||||
|
||||
echo "Listing bin directory..."
|
||||
ls -la bin
|
||||
|
||||
- name: Create Release
|
||||
run: |
|
||||
cd hello_gitea
|
||||
# Create release using Gitea API
|
||||
echo "Creating release..."
|
||||
curl -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITEATOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
@@ -71,12 +79,13 @@ jobs:
|
||||
}' \
|
||||
"https://direct-dev.ru/gitea/api/v1/repos/GiteaAdmin/hello_gitea/releases"
|
||||
|
||||
# Upload assets
|
||||
echo "Getting release id..."
|
||||
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.GITEATOKEN }}" \
|
||||
"https://direct-dev.ru/gitea/api/v1/repos/GiteaAdmin/hello_gitea/releases/tags/${{ github.ref_name }}" | \
|
||||
jq -r '.id')
|
||||
|
||||
# Upload all binaries
|
||||
echo "Uploading assets..."
|
||||
for file in bin/*.tar.gz; do
|
||||
echo "Uploading $file..."
|
||||
curl -X POST \
|
||||
@@ -86,6 +95,8 @@ jobs:
|
||||
"https://direct-dev.ru/gitea/api/v1/repos/GiteaAdmin/hello_gitea/releases/$RELEASE_ID/assets?name=$(basename $file)"
|
||||
done
|
||||
|
||||
echo "Release created successfully"
|
||||
|
||||
create-docker-image:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
@@ -111,7 +122,7 @@ jobs:
|
||||
run: |
|
||||
# Docker is already installed in docker:dind image
|
||||
docker --version
|
||||
|
||||
echo "Setting up Docker Buildx for multi-platform builds..."
|
||||
# Setup Docker Buildx for multi-platform builds
|
||||
docker buildx create --name go-buildx --use
|
||||
docker buildx inspect --bootstrap
|
||||
@@ -123,6 +134,7 @@ jobs:
|
||||
- name: Build multi-platform Docker images
|
||||
run: |
|
||||
cd hello_gitea
|
||||
echo "Building multi-platform images using buildx..."
|
||||
# Build multi-platform images using buildx
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
@@ -130,8 +142,11 @@ jobs:
|
||||
--tag ${{ secrets.DOCKERHUB_USERNAME }}/hello-api:latest \
|
||||
--push \
|
||||
.
|
||||
echo "Multi-platform images built successfully"
|
||||
|
||||
- name: Remove buildx
|
||||
run: |
|
||||
echo "Removing buildx..."
|
||||
docker buildx rm go-buildx
|
||||
|
||||
update-to-release-branch:
|
||||
@@ -142,6 +157,7 @@ jobs:
|
||||
steps:
|
||||
- name: Create Release Branch
|
||||
run: |
|
||||
echo "Creating release branch..."
|
||||
echo "=== GitHub Variables ==="
|
||||
echo "github.ref = ${{ github.ref }}"
|
||||
echo "github.ref_name = ${{ github.ref_name }}"
|
||||
@@ -179,4 +195,5 @@ jobs:
|
||||
|
||||
# Push changes to release branch
|
||||
echo "Pushing changes to release branch..."
|
||||
git push origin release --force
|
||||
git push origin release --force
|
||||
echo "Changes pushed to release branch successfully"
|
Reference in New Issue
Block a user