-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (71 loc) · 2.1 KB
/
release.yml
File metadata and controls
79 lines (71 loc) · 2.1 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
name: Publish YML
on:
push:
tags:
- '*'
jobs:
publish-ts-reader:
permissions:
id-token: write
if: startsWith(github.ref, 'refs/tags/pkg-')
defaults:
run:
working-directory: "./package/reader"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- run: npm version from-git --git-tag-version=false
- run: npm ci
- run: npm run build
- run: npm publish
publish-defintions:
permissions:
contents: write
packages: read
if: startsWith(github.ref, 'refs/tags/def-')
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set script permissions
run: chmod +x ./scripts/inject-version.sh
- name: Inject version
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#*-}" # removes everything up to the first dash
./scripts/inject-version.sh "$VERSION"
- name: Archive definitions folder
run: |
zip -r definitions.zip definitions
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
files: |
definitions.zip
generate_release_notes: true
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
publish-cli:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/cli-')
defaults:
run:
working-directory: "./crates/cli"
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set version
run: |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^cli-//')
sed -i "s/version = \"0.0.0\"/version = \"$VERSION\"/" Cargo.toml
- name: Cargo Login
run: cargo login ${{secrets.CRATES_IO_PUBLISH}}
- name: Publish crate
run: cargo publish --allow-dirty