Skip to content

Commit

Permalink
Testing out new semver check
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveKeehl committed Apr 7, 2024
1 parent 32c1ed1 commit dc84f65
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

on: [push]

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: Compare versions
uses: madhead/semver-utils@latest
id: version
with:
version: ${{ steps.latest-version.outputs.tag }}
compare-to: ${{ steps.package-version.outputs.current-version }}

- name: Check for new version
if: ${{ steps.version.outputs.comparison-result != '>' }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('The last version (${{ steps.package-version.outputs.current-version }}) and the current version (${{ steps.latest-version.outputs.tag }}) are the same')
release:
runs-on: ubuntu-latest
needs: check-version
steps:
- 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

0 comments on commit dc84f65

Please sign in to comment.