-
-
Notifications
You must be signed in to change notification settings - Fork 155
157 lines (150 loc) · 4.75 KB
/
nightly-new.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: snapshot-oss
# TODO: make it auto-snapshot/nightly/release (?)
on:
workflow_dispatch:
pull_request:
schedule:
- cron: 0 0 * * *
permissions:
contents: write
id-token: write
packages: write
jobs:
prepare-linux:
strategy:
fail-fast: true
matrix:
TARGET:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: sha_short
shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: dist/${{ env.TARGET }}
key: ${{ env.TARGET }}-${{ env.sha_short }}
- run: rustup toolchain install stable --profile minimal
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: "snapshot"
args: release --clean --snapshot --split
env:
TARGET: ${{ env.TARGET }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
prepare-darwin:
strategy:
fail-fast: true
matrix:
TARGET:
- x86_64-apple-darwin
- aarch64-apple-darwin
runs-on: macos-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: sha_short
shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: dist/${{ env.TARGET }}
key: ${{ env.TARGET }}-${{ env.sha_short }}
- run: rustup toolchain install stable --profile minimal
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: "snapshot"
args: release --clean --snapshot --split
env:
TARGET: ${{ env.TARGET }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
prepare-windows:
strategy:
fail-fast: true
matrix:
TARGET:
- x86_64-pc-windows-gnu
runs-on: macos-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: sha_short
shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: dist/${{ env.TARGET }}
key: ${{ env.TARGET }}-${{ env.sha_short }}
- run: rustup toolchain install stable --profile minimal
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: "snapshot"
args: release --clean --snapshot --split
env:
TARGET: ${{ env.TARGET }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
release:
runs-on: ubuntu-latest
needs:
- prepare-linux
- prepare-windows
- prepare-darwin
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: sha_short
shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# restore cache dirs
- uses: actions/cache@v4
with:
path: dist/x86_64-apple-darwin
key: x86_64-apple-darwin-${{ env.sha_short }}
- uses: actions/cache@v4
with:
path: dist/aarch64-apple-darwin
key: aarch64-apple-darwin-${{ env.sha_short }}
- uses: actions/cache@v4
with:
path: dist/x86_64-pc-windows-gnu
key: x86_64-pc-windows-gnu-${{ env.sha_short }}
- uses: actions/cache@v4
with:
path: dist/x86_64-unknown-linux-gnu
key: x86_64-unknown-linux-gnu-${{ env.sha_short }}
- uses: actions/cache@v4
with:
path: dist/aarch64-unknown-linux-gnu
key: aarch64-unknown-linux-gnu-${{ env.sha_short }}
# merge
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: "snapshot"
args: continue --merge
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
# MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}
# MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }}
# MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}
# MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
# MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }}