Skip to content

Commit

Permalink
ci: add AUR publish and Go binary release workflows
Browse files Browse the repository at this point in the history
This commit adds two new GitHub workflows to the project:

- `.github/workflows/aur.yaml`: A workflow that publishes the project to the Arch User Repository (AUR).
- `.github/workflows/build.yaml`: A workflow that builds and releases a Go binary for the project.

The AUR publish workflow is triggered on pushes to the `master` branch that include changes to the `PKGBUILD` file. The workflow uses the `KSXGitHub/github-actions-deploy-aur` action to publish the package to the AUR.

The Go binary release workflow is triggered on release creation. The workflow uses the `wangyoucao577/go-release-action` action to build and release the Go binary for the project. The workflow builds binaries for Linux, Windows, and Darwin (macOS) on both amd64 and arm64 architectures.
  • Loading branch information
tfkhdyt committed Jun 8, 2024
1 parent c8e0289 commit 203587f
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/aur.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish to AUR
on:
push:
branches:
- master
paths:
- PKGBUILD
jobs:
aur-publish:
if: github.repository_owner == 'tfkhdyt'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: KSXGitHub/[email protected]
with:
pkgname: urban-cli-bin
pkgbuild: ./PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update AUR package
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
33 changes: 33 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release Go binary
on:
release:
types: [created]
permissions:
contents: write
packages: write
jobs:
release-matrix:
runs-on: ubuntu-latest
strategy:
matrix:
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
exclude:
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
ldflags: '-w -s'
executable_compression: upx
md5sum: FALSE
sha256sum: TRUE

0 comments on commit 203587f

Please sign in to comment.