-
Notifications
You must be signed in to change notification settings - Fork 294
67 lines (58 loc) · 1.78 KB
/
release.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
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
check_for_relevant_changes:
runs-on: ubuntu-latest
outputs:
shouldRun: ${{ steps.check_changes.outputs.shouldRun }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get changed files
id: get_changed_files
uses: Ana06/get-changed-files@v2.2.0
- name: Check for changes in specific paths
id: check_changes
run: |
for file in ${{ steps.get_changed_files.outputs.all }}; do
if [[ $file =~ ^generator/konfig-dash/ && ! $file =~ \.md$ ]]; then
echo "shouldRun=true" >> "$GITHUB_OUTPUT"
exit 0
fi
done
release:
needs: check_for_relevant_changes
if: needs.check_for_relevant_changes.outputs.shouldRun == 'true'
name: Release
runs-on: ubuntu-latest
env:
DIRECTORY: ./generator/konfig-dash
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
defaults:
run:
working-directory: ${{ env.DIRECTORY }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install Dependencies
run: yarn
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: yarn changeset:version
cwd: ${{ env.DIRECTORY }}
title: Version Packages & Generate Artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish if changesets do not exist
if: steps.changesets.outputs.hasChangesets == 'false'
run: yarn changeset:publish