diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5d72bc4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + - name: Build binaries + run: | + mkdir -p dist + GOOS=darwin GOARCH=amd64 go build -o dist/sbx-darwin-amd64 . + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref_name }} + release_name: ${{ github.ref_name }} + body: | + This is an automated release for version ${{ github.ref_name }}. + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload macOS binary + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: dist/sbx-darwin-amd64 + asset_name: sbx-darwin-amd64 + asset_content_type: application/octet-stream diff --git a/.gitignore b/.gitignore index 69590c4..adfdb98 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ sbx +dist