-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
69 lines (67 loc) · 2.07 KB
/
build.yml
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: Build and release specs
on:
push:
paths:
- "src/**/*.ts"
- "!package.json"
branches:
# We only want to create a new release when
# - a pr is merged to master
# - we push into master
- "master"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.FIG_BOT_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version-file: package.json
# Install all dependencies
- name: Install pnpm
uses: pnpm/[email protected]
- name: install
run: pnpm install --frozen-lockfile
# Transpile all specs from ts to js
- name: build
run: pnpm build
# Zip the transpiled files into the specs.zip file
- name: bundle files
run: |
mv build/ specs/
mv icons/ specs/
zip -r specs.zip specs/
mv specs/ build/
mv build/icons icons
# Bump the version and create a git tag with the new version
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
tag_prefix: spec-build-number-
# Bump versions in full numbers (1.0.0 -> 2.0.0)
default_bump: minor
github_token: ${{ secrets.GITHUB_TOKEN }}
# Create a new github release with the newly created specs.zip file
- name: Release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
with:
files: specs.zip
tag_name: ${{ steps.tag_version.outputs.new_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Automated Version Bump"
uses: "phips28/gh-action-bump-version@master"
env:
GITHUB_TOKEN: ${{ secrets.FIG_BOT_TOKEN }}
with:
skip-tag: "true"
- name: Publish to npm
uses: JS-DevTools/npm-publish@v3
with:
access: public
token: ${{ secrets.NPM_PUBLISH_TOKEN }}