-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (60 loc) · 2.18 KB
/
Copy pathrelease-please.yaml
File metadata and controls
64 lines (60 loc) · 2.18 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
on:
push:
branches:
- main
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
prs: ${{ steps.release-please.outputs.prs }}
steps:
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
id: generate-token
with:
app-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: release-please
with:
token: ${{ steps.generate-token.outputs.token }}
update-cargo-lock:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.prs }}
steps:
- name: Find the rustac release PR branch
id: pr
env:
PRS: ${{ needs.release-please.outputs.prs }}
run: |
branch="$(echo "$PRS" | jq -r '.[] | select(.headBranchName == "release-please--branches--main") | .headBranchName')"
echo "branch=$branch" >> "$GITHUB_OUTPUT"
- if: ${{ steps.pr.outputs.branch != '' }}
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
id: generate-token
with:
app-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
- name: Checkout PR branch
if: ${{ steps.pr.outputs.branch != '' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ steps.generate-token.outputs.token }}
ref: ${{ steps.pr.outputs.branch }}
- name: Update Cargo.lock
if: ${{ steps.pr.outputs.branch != '' }}
run: cargo update --workspace
- name: Commit and push changes
if: ${{ steps.pr.outputs.branch != '' }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --staged --quiet || git commit -m "chore: update Cargo.lock"
git push