-
Notifications
You must be signed in to change notification settings - Fork 302
116 lines (107 loc) · 3.82 KB
/
publish-webui.yml
File metadata and controls
116 lines (107 loc) · 3.82 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Publish WebUI components
on:
push:
tags:
- "webui-*"
permissions:
contents: read
concurrency:
group: publish-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
prepare:
if: github.repository == 'eclipse/openvsx'
runs-on: ubuntu-22.04
outputs:
release-tag: ${{ steps.context.outputs.RELEASE_TAG }}
release-version: ${{ steps.context.outputs.RELEASE_VERSION }}
project-version: ${{ steps.context.outputs.PROJECT_VERSION }}
npm-tag: ${{ steps.context.outputs.NPM_TAG }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 0
- name: "Setup context"
id: context
shell: bash
env:
REF: ${{ github.ref }}
REF_NAME: ${{ github.ref_name }}
run: |
echo "RELEASE_TAG=${REF_NAME}" >> $GITHUB_OUTPUT
VERSION=$(echo ${REF_NAME} | sed 's/webui-//')
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_OUTPUT
PROJECT_VERSION=$(jq -r .version webui/package.json)
echo "PROJECT_VERSION=$VERSION" >> $GITHUB_OUTPUT
# if the tag contains '-rc', build and publish a release candidate
if [[ "${REF_NAME}" =~ ^.*-rc.* ]]; then
echo "NPM_TAG=next" >> $GITHUB_OUTPUT
else
echo "NPM_TAG=latest" >> $GITHUB_OUTPUT
if [[ "${VERSION}" != "${PROJECT_VERSION}" ]]; then
echo "Project version '${PROJECT_VERSION}' does not match version from tag '${VERSION}'."
exit 1
fi
fi
npm-publish:
name: "Publish to npm"
runs-on: ubuntu-22.04
needs: ['prepare']
permissions:
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: '24.x'
package-manager-cache: false
registry-url: 'https://registry.npmjs.org'
- name: Install Yarn
working-directory: webui
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Build CLI
working-directory: webui
env:
VERSION: ${{ needs.prepare.outputs.release-version }}
run: |
yarn
npm version ${VERSION} --allow-same-version
yarn run prepare
- name: Publish
working-directory: webui
env:
NPM_TAG: ${{ needs.prepare.outputs.npm-tag }}
run: |
npm publish --provenance --access public --tag ${NPM_TAG}
github-publish:
runs-on: ubuntu-22.04
needs: ['prepare', 'npm-publish']
if: ${{ needs.prepare.outputs.npm-tag == 'latest' }}
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: "Extract release notes"
id: extract-release-notes
uses: ffurrer2/extract-release-notes@202313ec7461b6b9e401996714484690ab1ae105 # v3.0.0
with:
changelog_file: "webui/CHANGELOG.md"
release_notes_file: "webui/RELEASE_NOTES.md"
- name: "Create GitHub release"
# pin to 2.4.2 due to https://github.com/softprops/action-gh-release/issues/703
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
with:
name: "Frontend Library v${{ needs.prepare.outputs.release-version }}"
tag_name: "${{ needs.prepare.outputs.release-tag }}"
body_path: "webui/RELEASE_NOTES.md"
draft: false
prerelease: false
generate_release_notes: false
make_latest: false