-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (66 loc) · 1.87 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
permissions:
contents: write
jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: package.json
cache: 'npm'
cache-dependency-path: |
package.json
package-lock.json
- run: npm ci
- run: npm test
- name: Setup ldid
uses: MOZGIII/install-ldid-action@v1
with:
tag: v2.1.5-procursus6
- name: Setup QEMU/binfmt
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Build executable files
run: npm run pkg
- name: Cache executable files built
uses: actions/cache/save@v3
with:
path: pkg
key: ${{ github.run_id }}-${{ github.run_number }}
goreleaser:
needs: test-and-build
runs-on: ubuntu-latest
steps:
# https://github.com/goreleaser/goreleaser/issues/1715#issuecomment-667002748
- run: |
sudo snap install --classic snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Restore cached executable files previously built
uses: actions/cache/restore@v3
with:
path: pkg
key: ${{ github.run_id }}-${{ github.run_number }}
- uses: actions/setup-go@v4
with:
go-version: '>=1.19.3'
cache: false
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_PAT }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}