2021-05-05 00:57:33 +03:00
|
|
|
name: release
|
2021-08-09 19:07:26 +03:00
|
|
|
on:
|
2021-05-05 00:57:33 +03:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-12-17 02:47:32 +03:00
|
|
|
- uses: actions/checkout@v4
|
2021-05-05 00:57:33 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-12-11 06:07:56 +03:00
|
|
|
- uses: actions/setup-go@v5
|
2021-05-05 00:57:33 +03:00
|
|
|
with:
|
2023-07-11 07:55:53 +03:00
|
|
|
go-version-file: go.mod
|
2022-04-19 22:43:30 +03:00
|
|
|
check-latest: true
|
2024-04-10 15:55:24 +03:00
|
|
|
- uses: actions/cache@v4
|
2021-05-05 00:57:33 +03: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 05:15:28 +03:00
|
|
|
uses: goreleaser/goreleaser-action@v5
|
2021-05-05 00:57:33 +03:00
|
|
|
with:
|
2021-10-24 19:36:09 +03:00
|
|
|
version: latest
|
2023-07-10 20:15:16 +03:00
|
|
|
args: release --clean
|
2021-05-05 00:57:33 +03:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
2023-08-11 09:14:41 +03:00
|
|
|
- name: Winget
|
|
|
|
uses: vedantmgoyal2009/winget-releaser@v2
|
|
|
|
with:
|
|
|
|
identifier: nektos.act
|
|
|
|
installers-regex: '_Windows_\w+\.zip$'
|
|
|
|
token: ${{ secrets.WINGET_TOKEN }}
|
2021-05-05 00:57:33 +03:00
|
|
|
- name: Chocolatey
|
|
|
|
uses: ./.github/actions/choco
|
|
|
|
with:
|
|
|
|
version: ${{ github.ref }}
|
|
|
|
apiKey: ${{ secrets.CHOCO_APIKEY }}
|
2021-12-08 21:49:33 +03:00
|
|
|
push: true
|
2023-01-20 21:22:58 +03:00
|
|
|
- name: GitHub CLI extension
|
2023-11-20 05:53:47 +03:00
|
|
|
uses: actions/github-script@v7
|
2023-01-20 21:22:58 +03: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 05:55:22 +03:00
|
|
|
ref: context.ref,
|
2023-01-20 21:22:58 +03:00
|
|
|
sha: mainRef.object.sha,
|
|
|
|
});
|