2021-05-04 16:57:33 -05:00
|
|
|
name: release
|
2021-08-09 11:07:26 -05:00
|
|
|
on:
|
2021-05-04 16:57:33 -05:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
|
2021-08-30 13:06:20 -05:00
|
|
|
env:
|
2022-03-29 15:10:32 -05:00
|
|
|
GO_VERSION: 1.18
|
2021-08-30 13:06:20 -05:00
|
|
|
|
2021-05-04 16:57:33 -05:00
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-14 10:14:32 -05:00
|
|
|
- uses: actions/checkout@v3
|
2021-05-04 16:57:33 -05:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-03-19 22:31:00 -05:00
|
|
|
- uses: actions/setup-go@v4
|
2021-05-04 16:57:33 -05:00
|
|
|
with:
|
2021-08-30 13:06:20 -05:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2022-04-19 14:43:30 -05:00
|
|
|
check-latest: true
|
2022-03-28 15:05:07 -05:00
|
|
|
- uses: actions/cache@v3
|
2021-05-04 16:57:33 -05:00
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
- name: GoReleaser
|
2022-12-19 09:46:21 -06:00
|
|
|
uses: goreleaser/goreleaser-action@v4
|
2021-05-04 16:57:33 -05:00
|
|
|
with:
|
2021-10-24 11:36:09 -05:00
|
|
|
version: latest
|
2023-07-10 12:15:16 -05:00
|
|
|
args: release --clean
|
2021-05-04 16:57:33 -05:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
|
|
|
- name: Chocolatey
|
|
|
|
uses: ./.github/actions/choco
|
|
|
|
with:
|
|
|
|
version: ${{ github.ref }}
|
|
|
|
apiKey: ${{ secrets.CHOCO_APIKEY }}
|
2021-12-08 12:49:33 -06:00
|
|
|
push: true
|
2023-01-20 12:22:58 -06:00
|
|
|
- name: GitHub CLI extension
|
2023-01-22 20:56:38 -06:00
|
|
|
uses: actions/github-script@v6
|
2023-01-20 12:22:58 -06: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-01-31 20:55:22 -06:00
|
|
|
ref: context.ref,
|
2023-01-20 12:22:58 -06:00
|
|
|
sha: mainRef.object.sha,
|
|
|
|
});
|
2023-02-13 11:59:19 -06:00
|
|
|
winget:
|
|
|
|
needs: release
|
|
|
|
runs-on: windows-latest # Action can only run on Windows
|
|
|
|
steps:
|
|
|
|
- uses: vedantmgoyal2009/winget-releaser@v2
|
|
|
|
with:
|
|
|
|
identifier: nektos.act
|
|
|
|
installers-regex: '_Windows_\w+\.zip$'
|
|
|
|
token: ${{ secrets.WINGET_TOKEN }}
|