Skip to content

Debugging

Debugging #26

Workflow file for this run

name: Release
on: [push]
env:
OLD_VERSION: 1.0.4
NEW_VERSION: 2.1.0
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: ${{ env.OLD_VERSION }}
- run: |
echo "Release: ${{ steps.version.outputs.release }}"
echo "inc-major: ${{ steps.version.outputs.inc-major }}"
echo "inc-minor: ${{ steps.version.outputs.inc-minor }}"
echo "inc-patch: ${{ steps.version.outputs.inc-patch }}"
- name: Detected invalid semver upgrade
if: ${{ env.NEW_VERSION != steps.version.outputs.inc-major && env.NEW_VERSION != steps.version.outputs.inc-minor && env.NEW_VERSION != steps.version.outputs.inc-patch }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('Invalid semver upgrade (${{ env.OLD_VERSION }} -> ${{ env.NEW_VERSION }})')
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