-
Notifications
You must be signed in to change notification settings - Fork 19
96 lines (80 loc) · 2.65 KB
/
backstage-release-snapshot.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
name: Publish snapshot on NPM
on:
# When manually triggered
workflow_dispatch:
# When there's a new commit in main branch
push:
branches: [ "main" ]
jobs:
publish-release-snapshot-on-npm:
name: Publish release on NPM
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup release name
run: |
# get the short git hash
git_hash=$(git rev-parse --short "$GITHUB_SHA")
# build the release name
new_version="0.0.0-snapshot.${git_hash}"
echo "RELEASE_NAME=${new_version}" >> $GITHUB_ENV
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'backstage/.nvmrc'
cache: 'yarn'
cache-dependency-path: 'backstage/yarn.lock'
- name: Print environment
run: |
node --version
yarn --version
- name: Print release name
run: |
echo "Release name: ${RELEASE_NAME}"
- name: Install dependencies
shell: bash
working-directory: ./backstage
run: yarn --prefer-offline --frozen-lockfile
- name: Install tooling
shell: bash
working-directory: ./backstage
run: npm install @backstage/cli -g
- name: Run tests
shell: bash
working-directory: ./backstage
run: |
export PATH="./node_modules/.bin/:$PATH"
yarn test
- name: Build
shell: bash
working-directory: ./backstage
run: |
export PATH="./node_modules/.bin/:$PATH"
yarn tsc
yarn build:all
- name: Update version of knative-event-mesh-backend plugin
shell: bash
working-directory: ./backstage/plugins/knative-event-mesh-backend
run: |
export PATH="./node_modules/.bin/:$PATH"
yarn version --new-version ${RELEASE_NAME} --no-git-tag-version
- name: Prepack knative-event-mesh-backend plugin
shell: bash
working-directory: ./backstage/plugins/knative-event-mesh-backend
run: |
export PATH="./node_modules/.bin/:$PATH"
yarn prepack
- name: Publish knative-event-mesh-backend plugin
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: backstage/plugins/knative-event-mesh-backend
tag: snapshot
- name: Postpack knative-event-mesh-backend plugin
shell: bash
working-directory: ./backstage/plugins/knative-event-mesh-backend
run: |
export PATH="./node_modules/.bin/:$PATH"
yarn postpack