2021-05-05 05:57:33 +08:00
|
|
|
name: release
|
2021-08-10 00:07:26 +08:00
|
|
|
on:
|
2021-05-05 05:57:33 +08:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-12-17 07:47:32 +08:00
|
|
|
- uses: actions/checkout@v4
|
2021-05-05 05:57:33 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-12-11 11:07:56 +08:00
|
|
|
- uses: actions/setup-go@v5
|
2021-05-05 05:57:33 +08:00
|
|
|
with:
|
2023-07-11 12:55:53 +08:00
|
|
|
go-version-file: go.mod
|
2022-04-20 03:43:30 +08:00
|
|
|
check-latest: true
|
2022-03-29 04:05:07 +08:00
|
|
|
- uses: actions/cache@v3
|
2021-05-05 05:57:33 +08:00
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
- name: GoReleaser
|
2023-09-18 10:15:28 +08:00
|
|
|
uses: goreleaser/goreleaser-action@v5
|
2021-05-05 05:57:33 +08:00
|
|
|
with:
|
2021-10-25 00:36:09 +08:00
|
|
|
version: latest
|
2023-07-11 01:15:16 +08:00
|
|
|
args: release --clean
|
2021-05-05 05:57:33 +08:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
2023-08-11 14:14:41 +08:00
|
|
|
- name: Winget
|
|
|
|
uses: vedantmgoyal2009/winget-releaser@v2
|
|
|
|
with:
|
|
|
|
identifier: nektos.act
|
|
|
|
installers-regex: '_Windows_\w+\.zip$'
|
|
|
|
token: ${{ secrets.WINGET_TOKEN }}
|
2021-05-05 05:57:33 +08:00
|
|
|
- name: Chocolatey
|
|
|
|
uses: ./.github/actions/choco
|
|
|
|
with:
|
|
|
|
version: ${{ github.ref }}
|
|
|
|
apiKey: ${{ secrets.CHOCO_APIKEY }}
|
2021-12-09 02:49:33 +08:00
|
|
|
push: true
|
2023-01-21 02:22:58 +08:00
|
|
|
- name: GitHub CLI extension
|
2023-11-20 10:53:47 +08:00
|
|
|
uses: actions/github-script@v7
|
2023-01-21 02:22:58 +08:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
|
|
|
script: |
|
|
|
|
const mainRef = (await github.rest.git.getRef({
|
|
|
|
owner: 'nektos',
|
|
|
|
repo: 'gh-act',
|
|
|
|
ref: 'heads/main',
|
|
|
|
})).data;
|
|
|
|
console.log(mainRef);
|
|
|
|
github.rest.git.createRef({
|
|
|
|
owner: 'nektos',
|
|
|
|
repo: 'gh-act',
|
2023-02-01 10:55:22 +08:00
|
|
|
ref: context.ref,
|
2023-01-21 02:22:58 +08:00
|
|
|
sha: mainRef.object.sha,
|
|
|
|
});
|