Skip to content

Commit 8048dd1

Browse files
committed
ci: add building of extension zip as part of release
ci: add npm publish on release publish
1 parent 58d312f commit 8048dd1

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/buildext.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Extension Zip
2+
3+
on: push
4+
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Check out Git repository
11+
uses: actions/checkout@v2
12+
13+
- name: Install Node.js, NPM and Yarn
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
cache: 'yarn'
18+
19+
- name: Yarn Install
20+
run: yarn install --frozen-lockfile
21+
22+
- name: Yarn Build
23+
run: yarn run build
24+
25+
- name: Create ZIP for Extension
26+
run: |
27+
cd dist/ext
28+
zip ../ext.zip -r ./
29+
30+
- name: Get Package Version
31+
id: package-version
32+
uses: martinbeentjes/npm-get-version-action@main
33+
34+
- name: Upload Extension ZIP
35+
uses: actions/upload-artifact@v3
36+
with:
37+
name: archivewebpage-ext-${{ steps.package-version.outputs.current-version}}.zip
38+
path: dist/ext.zip

.github/workflows/npm-release.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build-release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: '18.x'
14+
registry-url: 'https://registry.npmjs.org'
15+
cache: 'yarn'
16+
17+
- name: Yarn Install
18+
run: yarn install --frozen-lockfile
19+
20+
- name: Yarn Build
21+
run: yarn run build
22+
23+
- run: npm publish
24+
env:
25+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)