-
-
Notifications
You must be signed in to change notification settings - Fork 937
132 lines (116 loc) · 4.98 KB
/
prepare_release_apps.yml
File metadata and controls
132 lines (116 loc) · 4.98 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
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
name: Prepare Release Apps
permissions: {}
on:
workflow_dispatch:
schedule:
# Triggers every Monday at 5pm Shanghai time (9am UTC)
- cron: "0 9 * * 1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
prepare:
if: github.repository == 'oxc-project/oxc'
name: Prepare Release
runs-on: ubuntu-latest
outputs:
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
oxlint_version: ${{ steps.run.outputs.OXLINT_VERSION }}
oxfmt_version: ${{ steps.run.outputs.OXFMT_VERSION }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16
with:
cache-key: warm
tools: cargo-release-oxc
- name: Generate version and changelog
id: run
run: |
mkdir -p target
cargo release-oxc update --release oxlint --release oxfmt
echo "OXLINT_VERSION=$(cat ./target/OXLINT_VERSION)" >> $GITHUB_OUTPUT
echo "OXFMT_VERSION=$(cat ./target/OXFMT_VERSION)" >> $GITHUB_OUTPUT
{
echo "# Oxlint"
cat ./target/OXLINT_CHANGELOG
echo ""
echo "# Oxfmt"
cat ./target/OXFMT_CHANGELOG
} > ./target/PR_BODY.md
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
- name: Rebuild NAPI bindings
run: |
pnpm --filter oxlint-app run build-dev
pnpm --filter oxfmt-app run build-dev
- name: Update Cargo.lock
run: cargo check
- uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
id: pr
with:
# bot account with PAT required for triggering workflow runs
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
token: ${{ secrets.OXC_BOT_PAT }}
commit-message: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}"
title: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}"
branch: release/apps
branch-suffix: timestamp
base: main
body-path: ./target/PR_BODY.md
assignees: Boshen
ecosystem-ci:
needs: prepare
name: Trigger Ecosystem CI
runs-on: ubuntu-slim
permissions:
pull-requests: write
contents: write
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
id: comment-oxlint
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ needs.prepare.outputs.pull-request-number }}
body: |
Triggering Oxlint Ecosystem CI
https://github.com/oxc-project/oxc-ecosystem-ci/actions/workflows/oxlint-ci.yml
- uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
id: comment-oxfmt
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ needs.prepare.outputs.pull-request-number }}
body: |
Triggering Oxfmt Ecosystem CI
https://github.com/oxc-project/oxc-ecosystem-ci/actions/workflows/oxfmt-ci.yml
- uses: benc-uk/workflow-dispatch@7a027648b88c2413826b6ddd6c76114894dc5ec4 # v1.3.1
with:
repo: oxc-project/oxc-ecosystem-ci
workflow: oxlint-ci.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment-oxlint.outputs.comment-id }}" }'
- uses: benc-uk/workflow-dispatch@7a027648b88c2413826b6ddd6c76114894dc5ec4 # v1.3.1
with:
repo: oxc-project/oxc-ecosystem-ci
workflow: oxfmt-ci.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment-oxfmt.outputs.comment-id }}" }'
website:
needs: prepare
name: Update oxc.rs
runs-on: ubuntu-slim
permissions:
actions: write
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: benc-uk/workflow-dispatch@7a027648b88c2413826b6ddd6c76114894dc5ec4 # v1.3.1
with:
repo: oxc-project/website
workflow: release.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "version": "${{ needs.prepare.outputs.oxlint_version }}" }'