Skip to content

Commit e1b41e6

Browse files
committed
Add github actions
1 parent 407d856 commit e1b41e6

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: 16
21+
22+
- name: Install dependencies
23+
run: npm install --no-progress --no-package-lock
24+
25+
- name: Lint
26+
run: npm run lint
27+
28+
- name: Test
29+
run: xvfb-run npm run test

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- v*.*
6+
7+
env:
8+
PLUGIN_NAME: tropy-plugin-iiif
9+
10+
jobs:
11+
create-release:
12+
name: Create release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: 16
23+
24+
- name: Install dependencies and build
25+
run: |
26+
npm install
27+
npm run build
28+
29+
- name: Generate version name
30+
id: version
31+
run: echo "::set-output name=version::${{ env.PLUGIN_NAME }}-${{github.ref_name}}"
32+
33+
- name: Create zip file
34+
run: |
35+
mkdir ${{ steps.version.outputs.version }}
36+
cp index.js package.json icon.svg third-party-licenses.txt ${{ steps.version.outputs.version }}
37+
zip -r ${{ steps.version.outputs.version }}.zip ${{ steps.version.outputs.version }}
38+
39+
- name: Create release and upload zip file
40+
uses: ncipollo/release-action@v1
41+
with:
42+
artifacts: ${{ steps.version.outputs.version }}.zip
43+
prerelease: true
44+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)