2022-06-29 22:15:58 +08:00
|
|
|
name: Go Release
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
jobs:
|
|
|
|
release-binary:
|
|
|
|
name: Release Binary
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: '^1.18'
|
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Cache go module
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
|
|
|
|
- name: Get dependencies and run test
|
|
|
|
run: |
|
|
|
|
go test ./...
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
env:
|
|
|
|
NAME: nali
|
|
|
|
BINDIR: bin
|
|
|
|
run: make -j releases && make sha256sum
|
|
|
|
|
|
|
|
- name: Upload Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
files: bin/*
|
|
|
|
draft: true
|
|
|
|
prerelease: true
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
path: bin
|
|
|
|
|
|
|
|
release-aur:
|
|
|
|
name: Release Aur
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Publish AUR package
|
2022-06-29 22:29:42 +08:00
|
|
|
uses: guumaster/aur-publish-docker-action@master
|
2022-06-29 22:15:58 +08:00
|
|
|
with:
|
|
|
|
package_name: nali-go
|
|
|
|
commit_username: 'zu1k'
|
|
|
|
commit_email: 'i@zu1k.com'
|
|
|
|
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|