-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (79 loc) 路 3.23 KB
/
Copy pathrelease-plz.yml
File metadata and controls
92 lines (79 loc) 路 3.23 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
name: Release PLZ
permissions:
contents: write
id-token: write
pull-requests: write
on:
push:
branches:
- main
jobs:
release-pr:
name: Release PR
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.PACT_FOUNDATION_BOT_APP_ID }}
private-key: ${{ secrets.PACT_FOUNDATION_BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Configure git identity
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config user.name "${{ steps.app-token.outputs.app-slug }}[bot]"
git config user.email "$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq '.id')+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
- name: Run release-plz release-pr
uses: release-plz/action@e8792575c7f2366cf6ff3ccc33ead9ace5b691c7 # v0.5.130
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
release:
name: Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: crates-io
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Authenticate with crates.io
uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5
id: auth
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.PACT_FOUNDATION_BOT_APP_ID }}
private-key: ${{ secrets.PACT_FOUNDATION_BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Configure git identity
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config user.name "${{ steps.app-token.outputs.app-slug }}[bot]"
git config user.email "$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq '.id')+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
- name: Run release-plz release
uses: release-plz/action@e8792575c7f2366cf6ff3ccc33ead9ace5b691c7 # v0.5.130
with:
command: release
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}