try to fix bad permissions on upload assets #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: Set up Environment Variables | |
run: echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV | |
- name: Build for Linux amd64 | |
env: | |
GOOS: linux | |
GOARCH: amd64 | |
VERSION: ${{ env.VERSION }} | |
run: | | |
mkdir -p build | |
OUTPUT="build/bruno-init-suite-${GOOS}-${GOARCH}" | |
env GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags "-X bruno-init-suite/internal/version.Version=${VERSION}" -o "${OUTPUT}" | |
tar -czvf "${OUTPUT}.tar.gz" -C build "bruno-init-suite-${GOOS}-${GOARCH}" | |
- name: Build for Linux arm64 | |
env: | |
GOOS: linux | |
GOARCH: arm64 | |
VERSION: ${{ env.VERSION }} | |
run: | | |
OUTPUT="build/bruno-init-suite-${GOOS}-${GOARCH}" | |
env GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags "-X bruno-init-suite/internal/version.Version=${VERSION}" -o "${OUTPUT}" | |
tar -czvf "${OUTPUT}.tar.gz" -C build "bruno-init-suite-${GOOS}-${GOARCH}" | |
- name: Build for macOS amd64 | |
env: | |
GOOS: darwin | |
GOARCH: amd64 | |
VERSION: ${{ env.VERSION }} | |
run: | | |
OUTPUT="build/bruno-init-suite-${GOOS}-${GOARCH}" | |
env GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags "-X bruno-init-suite/internal/version.Version=${VERSION}" -o "${OUTPUT}" | |
tar -czvf "${OUTPUT}.tar.gz" -C build "bruno-init-suite-${GOOS}-${GOARCH}" | |
- name: Build for macOS arm64 | |
env: | |
GOOS: darwin | |
GOARCH: arm64 | |
VERSION: ${{ env.VERSION }} | |
run: | | |
OUTPUT="build/bruno-init-suite-${GOOS}-${GOARCH}" | |
env GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags "-X bruno-init-suite/internal/version.Version=${VERSION}" -o "${OUTPUT}" | |
tar -czvf "${OUTPUT}.tar.gz" -C build "bruno-init-suite-${GOOS}-${GOARCH}" | |
- name: Build for Windows amd64 | |
env: | |
GOOS: windows | |
GOARCH: amd64 | |
VERSION: ${{ env.VERSION }} | |
run: | | |
OUTPUT="build/bruno-init-suite-${GOOS}-${GOARCH}.exe" | |
env GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags "-X bruno-init-suite/internal/version.Version=${VERSION}" -o "${OUTPUT}" | |
zip "${OUTPUT}.zip" -j "${OUTPUT}" | |
- name: Build for Windows 386 | |
env: | |
GOOS: windows | |
GOARCH: 386 | |
VERSION: ${{ env.VERSION }} | |
run: | | |
OUTPUT="build/bruno-init-suite-${GOOS}-${GOARCH}.exe" | |
env GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags "-X bruno-init-suite/internal/version.Version=${VERSION}" -o "${OUTPUT}" | |
zip "${OUTPUT}.zip" -j "${OUTPUT}" | |
- name: Check if Release Exists | |
id: check_release | |
run: | | |
if gh release view ${{ github.ref }}; then | |
echo "release_exists=true" >> $GITHUB_ENV | |
else | |
echo "release_exists=false" >> $GITHUB_ENV | |
fi | |
- name: Create Release | |
id: create_release | |
if: env.release_exists == 'false' | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
body: | | |
# Release Notes | |
- Features and improvements: | |
- Added support for macOS arm64 | |
- Improved performance on Linux | |
- Bug fixes for Windows builds | |
- name: Upload Linux amd64 Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: build/bruno-init-suite-linux-amd64.tar.gz | |
asset_name: bruno-init-suite-linux-amd64.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload Linux arm64 Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: build/bruno-init-suite-linux-arm64.tar.gz | |
asset_name: bruno-init-suite-linux-arm64.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload macOS amd64 Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: build/bruno-init-suite-darwin-amd64.tar.gz | |
asset_name: bruno-init-suite-darwin-amd64.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload macOS arm64 Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: build/bruno-init-suite-darwin-arm64.tar.gz | |
asset_name: bruno-init-suite-darwin-arm64.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload Windows amd64 Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: build/bruno-init-suite-windows-amd64.exe.zip | |
asset_name: bruno-init-suite-windows-amd64.exe.zip | |
asset_content_type: application/zip | |
- name: Upload Windows 386 Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: build/bruno-init-suite-windows-386.exe.zip | |
asset_name: bruno-init-suite-windows-386.exe.zip | |
asset_content_type: application/zip |