beecs-cli v0.4.1 #6
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: | |
release: | |
types: [ created ] | |
jobs: | |
build-linux: | |
name: Linux build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get tag | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
shell: bash | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.22.x' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y libgl1-mesa-dev xorg-dev | |
go get ./... | |
- name: Build | |
run: GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -ldflags="-s -w" -o beecs . | |
- name: Compress binaries | |
run: | | |
tar -czf beecs-cli.tar.gz beecs | |
shell: bash | |
- name: Upload binaries | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: beecs-cli.tar.gz | |
asset_name: beecs-cli-${{ env.RELEASE_VERSION }}-linux-amd64.tar.gz | |
tag: ${{ github.ref }} | |
build-windows: | |
name: Windows build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get tag | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
shell: bash | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.22.x' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y gcc-mingw-w64 | |
go get ./... | |
- name: Build | |
run: GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -ldflags="-s -w" -o beecs.exe . | |
- name: Compress binaries | |
run: | | |
zip -r beecs-cli.zip beecs.exe | |
shell: bash | |
- name: Upload binaries | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: beecs-cli.zip | |
asset_name: beecs-cli-${{ env.RELEASE_VERSION }}-windows-amd64.zip | |
tag: ${{ github.ref }} | |
build-macos-arm64: | |
name: MacOS arm64 build | |
runs-on: macos-latest | |
steps: | |
- name: Get tag | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
shell: bash | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.22.x' | |
- name: Build | |
run: GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build -ldflags="-s -w" -o beecs . | |
- name: Compress binaries | |
run: | | |
zip -r beecs-cli.zip beecs | |
shell: bash | |
- name: Upload binaries | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: beecs-cli.zip | |
asset_name: beecs-cli-${{ env.RELEASE_VERSION }}-macos-arm64.zip | |
tag: ${{ github.ref }} | |
build-macos-amd64: | |
name: MacOS amd64 build | |
runs-on: macos-latest | |
steps: | |
- name: Get tag | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
shell: bash | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.22.x' | |
- name: Build | |
run: GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -ldflags="-s -w" -o beecs . | |
- name: Compress binaries | |
run: | | |
zip -r beecs-cli.zip beecs | |
shell: bash | |
- name: Upload binaries | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: beecs-cli.zip | |
asset_name: beecs-cli-${{ env.RELEASE_VERSION }}-macos-amd64.zip | |
tag: ${{ github.ref }} |