-
Notifications
You must be signed in to change notification settings - Fork 147
76 lines (66 loc) · 1.81 KB
/
release.yml
File metadata and controls
76 lines (66 loc) · 1.81 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
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build-artifacts:
permissions:
contents: write
uses: ./.github/workflows/build-artifacts.yml
verify:
needs: ['build-artifacts']
runs-on: ubuntu-latest
environment: release
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 50
- name: Fetch tags
run: git fetch --tags --force
- name: Cargo publish dry-run
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish --dry-run
cargo-publish:
needs: ['build-artifacts', 'verify']
runs-on: ubuntu-latest
environment: release
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 50
- name: Fetch tags
run: git fetch --tags --force
- name: Cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish
create-github-release:
needs: ['build-artifacts', 'verify']
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout .recent-changelog-entry
uses: actions/checkout@v6
with:
sparse-checkout: .recent-changelog-entry
sparse-checkout-cone-mode: false
- name: Download all workflow run artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
- name: Create Github release
working-directory: artifacts
run: |
gh release create "$GITHUB_REF_NAME" -F ../.recent-changelog-entry
ls | xargs -I{} zip -r {}.zip {}
ls *.zip | xargs gh release upload "$GITHUB_REF_NAME"