-
-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (47 loc) · 1.38 KB
/
test.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
name: 'Test'
on: [push]
env:
OLD_VERSION: 1.0.4
NEW_VERSION: 1.0.5
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.package-version.outputs.current-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get current version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
with:
path: 'packages/svelte-reveal'
- name: Get latest version
id: latest-version
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
- name: Check for new version
if: ${{ steps.package-version.outputs.current-version == steps.latest-version.outputs.tag }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('The last version and the current version are the same')
release:
runs-on: ubuntu-latest
needs: check-version
steps:
- run: echo ${{ needs.check-version.outputs.version }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build -- --filter=svelte-reveal