-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.62 KB
/
CI.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
name: CI
on:
pull_request:
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
node-version: '20.9.0'
cache: 'yarn'
- run: yarn install
- run: yarn gen
- run: yarn build
# Generate the OpenAPI spec. Yes, yarn test generates it.
- run: yarn test
env:
KITTYCAD_TOKEN: ${{ secrets.KITTYCAD_TOKEN }}
BASE_URL: "https://api.dev.kittycad.io/"
- name: check for changes
id: git-check
run: |
git add .
if git status | grep -q "Changes to be committed"
then echo "modified=true" >> $GITHUB_OUTPUT
else echo "modified=false" >> $GITHUB_OUTPUT
fi
- name: Commit changes, if any
if: steps.git-check.outputs.modified == 'true'
run: |
git add .
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git fetch origin
echo ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
git commit -am "Generated new lib" || true
git push
git push origin ${{ github.head_ref }}
- name: Bump package.json version
if: steps.git-check.outputs.modified == 'true'
run: |
npm version patch
git push origin ${{ github.head_ref }}