Skip to content

Release

Release #7

Workflow file for this run

name: Release
on:
workflow_dispatch:
jobs:
create-release:
name: Create GitHub Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 'v1.0.0'
release_name: 'v1.0.0'
draft: false
prerelease: false
build-and-upload:
name: Build and Upload Binaries
runs-on: ubuntu-latest
needs: create-release
strategy:
matrix:
os: [linux, darwin, windows, freebsd]
arch: [amd64, 386, arm64, arm]
exclude:
- os: darwin
arch: 386
- os: darwin
arch: arm
- os: windows
arch: arm64
- os: windows
arch: arm
- os: freebsd
arch: 386
- os: freebsd
arch: arm64
- os: freebsd
arch: arm
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build Binary
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o snapshot-migration-tool_${{ matrix.os }}_${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }}
- name: Upload Binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./snapshot-migration-tool_${{ matrix.os }}_${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }}
asset_name: snapshot-migration-tool_${{ matrix.os }}_${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }}
asset_content_type: application/octet-stream