-
Notifications
You must be signed in to change notification settings - Fork 52
101 lines (85 loc) · 3.02 KB
/
release.yaml
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
name: Build and NPM Release
on:
push:
tags:
- "v*"
jobs:
build-and-publish:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: [
# "packages/torii-wasm",
# "packages/torii-client",
"packages/create-burner",
"packages/create-dojo",
"packages/utils",
"packages/core",
"packages/react",
]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from tag
id: tag-version
run: |
echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install Protoc
uses: arduino/setup-protoc@v2
- uses: jetli/[email protected]
with:
version: "latest"
- uses: oven-sh/setup-bun@v1
# - name: Bun Link
# run: |
# bun install && bun link
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
scope: "@dojoengine"
- name: Install dependencies
run: |
cd ${{ matrix.package }}
bun install
- name: Build
run: |
cd ${{ matrix.package }}
bun run build
- name: NPM Publish
run: |
cd ${{ matrix.package }}
yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
create-release:
needs: build-and-publish
runs-on: ubuntu-latest
steps:
- name: Extract version from tag
id: tag-version
run: |
echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
- name: Create GitHub Release
run: |
curl -s \
-X POST \
-H "Authorization: token $GIT_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d '{
"tag_name": "v${{ steps.tag-version.outputs.version }}",
"name": "Release v${{ steps.tag-version.outputs.version }}",
"body": "Release of version ${{ steps.tag-version.outputs.version }}",
"draft": false,
"prerelease": false
}'
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}