forked from oxc-project/oxc
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 2 KB
/
release_crates.yml
File metadata and controls
69 lines (58 loc) · 2 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
name: Release Crates
permissions: {}
on:
workflow_dispatch:
push:
branches:
- main
paths:
- crates/oxc/Cargo.toml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
if: github.repository == 'oxc-project/oxc'
name: Release crates
runs-on: ubuntu-latest
permissions:
contents: write # For git tag push
id-token: write # Required for OIDC token exchange
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ secrets.OXC_BOT_PAT }}
fetch-depth: 0 # for changelog
persist-credentials: true
- uses: oxc-project/setup-rust@704e1648ce532a12b4d6fb98db0ba10afa3ae879 # v1.0.13
with:
cache-key: warm
tools: cargo-release-oxc
- run: cargo ck
- name: Generate changelog
run: |
mkdir -p target
cargo release-oxc changelog --release crates
- uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1.0.3
id: auth
- name: Run
id: run
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: |
cargo release-oxc publish --release crates
echo "TAG=$(cat ./target/CRATES_VERSION)" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
body_path: ./target/CRATES_CHANGELOG
name: oxc ${{ steps.run.outputs.TAG }}
tag_name: ${{ steps.run.outputs.TAG }}
target_commitish: ${{ github.sha }}
draft: false
make_latest: false # latest is reserved for apps
# Workaround for https://github.com/softprops/action-gh-release/issues/703
- name: Mark release as not latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release edit ${{ steps.run.outputs.TAG }} --latest=false