forked from MohamedAlosaili/gog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add release workflow for linux and macos builds
- Add GitHub Actions workflow for automated releases - Build for linux-amd64, darwin-amd64, and darwin-arm64 - Package binaries with README.md - Upload assets to GitHub releases
- Loading branch information
1 parent
d88cbb3
commit f7a7401
Showing
1 changed file
with
93 additions
and
0 deletions.
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,93 @@ | ||
name: Release Build | ||
"on": | ||
release: | ||
types: | ||
- published | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-amd64-linux: | ||
name: "Release - Linux - ${{ matrix.target }}" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- target: linux-amd64 | ||
archive: tar.gz | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.23' | ||
|
||
- name: Build | ||
run: | | ||
GOOS=linux GOARCH=amd64 go build -o gog . | ||
tar czf ${{ github.event.repository.name }}-${{github.ref_name}}-${{ matrix.target }}.tar.gz gog README.md | ||
- name: Upload release assets | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: ${{ github.event.repository.name }}-${{github.ref_name}}-${{ matrix.target }}.tar.gz | ||
|
||
build-amd64-macos: | ||
name: "Release - Macos - ${{ matrix.target }}" | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- target: darwin-amd64 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.23' | ||
|
||
- name: Build | ||
run: | | ||
GOOS=darwin GOARCH=amd64 go build -o gog . | ||
zip -9r ${{ github.event.repository.name }}-${{github.ref_name}}-${{ matrix.target }}.zip gog README.md | ||
- name: Upload release assets | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: ${{ github.event.repository.name }}-${{github.ref_name}}-${{ matrix.target }}.zip | ||
build-arm64-macos: | ||
name: "Release - Macos - ${{ matrix.target }}" | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- target: darwin-arm64 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.23' | ||
|
||
- name: Build | ||
run: | | ||
GOOS=darwin GOARCH=arm64 go build -o gog . | ||
zip -9r ${{ github.event.repository.name }}-${{github.ref_name}}-${{ matrix.target }}.zip gog README.md | ||
- name: Upload release assets | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: ${{ github.event.repository.name }}-${{github.ref_name}}-${{ matrix.target }}.zip |