forked from meroxa/cli-fig-autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (60 loc) · 1.84 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
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@v3
with:
token: ${{ secrets.FIG_BOT_TOKEN }}
# Install all dependencies
- name: install
run: npm install
# Transpile all specs from ts to js
- name: build
run: npm run build
# Zip the transpiled files into the specs.zip file
- name: bundle files
run: |
mv build/ specs/
zip -r specs.zip specs/
mv specs/ build/
# 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@de2c0eb89ae2a093876385947365aca7b0e5f844
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@v1
with:
access: public
token: ${{ secrets.NPM_PUBLISH_TOKEN }}