-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/runtest.yml | ||
|
||
build-and-release: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.23" | ||
|
||
- name: Build for Windows | ||
run: GOOS=windows GOARCH=amd64 go build -o sif-windows-amd64.exe ./cmd/sif | ||
|
||
- name: Build for macOS | ||
run: GOOS=darwin GOARCH=amd64 go build -o sif-macos-amd64 ./cmd/sif | ||
|
||
- name: Build for Linux | ||
run: GOOS=linux GOARCH=amd64 go build -o sif-linux-amd64 ./cmd/sif | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.sha }} | ||
release_name: Release ${{ github.sha }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Windows Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./sif-windows-amd64.exe | ||
asset_name: sif-windows-amd64.exe | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload macOS Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./sif-macos-amd64 | ||
asset_name: sif-macos-amd64 | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Linux Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./sif-linux-amd64 | ||
asset_name: sif-linux-amd64 | ||
asset_content_type: application/octet-stream |
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