-
Notifications
You must be signed in to change notification settings - Fork 22
101 lines (89 loc) · 2.75 KB
/
release.yml
File metadata and controls
101 lines (89 loc) · 2.75 KB
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
name: Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
get-next-version:
uses: semantic-release-action/next-release-version/.github/workflows/next-release-version.yml@0cdefe1224944c23645e5131f7a5189672c0df92 # v4
build-artifacts:
name: Build ${{ matrix.name }} artifacts
needs: get-next-version
if: needs.get-next-version.outputs.new-release-published == 'true'
strategy:
fail-fast: false
matrix:
include:
- name: Linux
label: linux
os: ubuntu-24.04
artifact_glob: floki-*.tar.gz
rpm: true
- name: macOS
label: macos
os: macos-latest
artifact_glob: floki-*.zip
rpm: false
uses: ./.github/workflows/build-artifacts.yml
with:
runner: ${{ matrix.os }}
toolchain: stable
artifact_glob: ${{ matrix.artifact_glob }}
artifact_name: dist-${{ matrix.label }}
upload_artifact: true
run_tests: false
rpm: ${{ matrix.rpm }}
release_version: ${{ needs.get-next-version.outputs.new-release-version }}
fetch_depth: '0'
release:
name: Release
runs-on: ubuntu-latest
needs:
- get-next-version
- build-artifacts
if: needs.get-next-version.outputs.new-release-published == 'true'
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Setup Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
with:
toolchain: stable
- name: Rust Cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: Install semantic-release-cargo
run: cargo install --locked semantic-release-cargo
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "node"
- name: Install dependencies
run: npm ci
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: dist-*
merge-multiple: true
path: dist
- name: Generate checksums
run: |
cd dist
for file in *; do
if [ "$file" = "SHA256SUMS.txt" ]; then
continue
fi
shasum -a 256 "$file"
done > SHA256SUMS.txt
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.PUBLISH_SECRET }}