diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5d9312e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,64 @@ +# Cut a GitHub Release whenever the shipped version changes. +# +# The dashboard links users to the releases page, and that page held a single +# entry from five months earlier while the product shipped daily — which tells a +# visitor the project is abandoned. Commit messages here already read as release +# notes, so the note is the commit body rather than a generated list of subjects. +name: Release + +on: + push: + branches: [main] + paths: + - 'frontend/package.json' + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 2 + + - name: Read version, and stop if it did not change + id: v + run: | + VERSION=$(node -p "require('./frontend/package.json').version") + PREV=$(git show HEAD~1:frontend/package.json 2>/dev/null | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).version" || echo "") + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + if [ "$VERSION" = "$PREV" ]; then + echo "unchanged=true" >> "$GITHUB_OUTPUT" + echo "Version unchanged ($VERSION) — nothing to release." + fi + + - name: Compose notes from the commit that shipped it + if: steps.v.outputs.unchanged != 'true' + id: notes + run: | + { + echo 'body<> "$GITHUB_OUTPUT" + + - name: Publish + if: steps.v.outputs.unchanged != 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + TAG="v${{ steps.v.outputs.version }}" + # Betas are marked pre-release so nobody is pointed at one by accident. + PRERELEASE="" + case "$TAG" in *beta*|*alpha*|*rc*) PRERELEASE="--prerelease" ;; esac + gh release create "$TAG" \ + --title "$TAG" \ + --notes "${{ steps.notes.outputs.body }}" \ + $PRERELEASE diff --git a/README.md b/README.md index a74e4bc..f2a350c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

- Version + Version License Docker TypeScript diff --git a/backend/package.json b/backend/package.json index b8f1ce8..88e5743 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "mikrotik-manager-backend", - "version": "0.23.29-beta", + "version": "0.23.30-beta", "description": "Mikrotik Network Management Platform - Backend API", "main": "dist/index.js", "scripts": { diff --git a/frontend/package.json b/frontend/package.json index 6c1a95a..4923cb0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "mikrotik-manager-frontend", - "version": "0.23.29-beta", + "version": "0.23.30-beta", "private": true, "type": "module", "scripts": { diff --git a/frontend/src/version.ts b/frontend/src/version.ts index 61f3f4d..79b02a7 100644 --- a/frontend/src/version.ts +++ b/frontend/src/version.ts @@ -1 +1 @@ -export const APP_VERSION = 'v0.23.29 Beta'; +export const APP_VERSION = 'v0.23.30 Beta';