mirror of
https://github.com/zu1k/nali.git
synced 2025-01-23 05:39:03 +08:00
f172e8f837
Signed-off-by: zu1k <i@zu1k.com>
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: Go
|
|
on: [push, pull_request]
|
|
jobs:
|
|
|
|
test-build:
|
|
name: Test and Build
|
|
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
|
|
run: go build
|
|
|
|
release-aur-git:
|
|
name: Release Aur Git
|
|
needs: [test-build]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get version
|
|
id: version
|
|
run: echo ::set-output name=version::$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
|
|
|
|
- name: Publish AUR package nali-go-git
|
|
uses: zu1k/aur-publish-action@master
|
|
with:
|
|
package_name: nali-go-git
|
|
commit_username: 'zu1k'
|
|
commit_email: 'i@zu1k.com'
|
|
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
|
new_release: ${{ steps.version.outputs.version }}
|