build: add automated release flow (#35)
* chore: update to reflect the current version * build: add automated release flow
This commit is contained in:
68
.github/workflows/release.yml
vendored
Normal file
68
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
name: release-please
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- base
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
release-please:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: google-github-actions/release-please-action@v4
|
||||
id: release
|
||||
with:
|
||||
release-type: node
|
||||
|
||||
# Handle the PR artifacts while the PR is open/updated
|
||||
# The output 'pr' is only present if a release PR was created or updated.
|
||||
- name: Checkout PR branch
|
||||
if: ${{ steps.release.outputs.pr }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# Use headBranchName from the PR object
|
||||
ref: ${{ fromJson(steps.release.outputs.pr).headBranchName }}
|
||||
|
||||
- name: Setup Node
|
||||
if: ${{ steps.release.outputs.pr }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'npm'
|
||||
|
||||
- name: Cache node_modules
|
||||
if: ${{ steps.release.outputs.pr }}
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install dependencies
|
||||
if: ${{ steps.release.outputs.pr }}
|
||||
run: npm ci
|
||||
|
||||
- name: Update version in Settings.vue
|
||||
if: ${{ steps.release.outputs.pr }}
|
||||
run: |
|
||||
NEW_VERSION="v${{ fromJson(steps.release.outputs.pr).version }}"
|
||||
# Use sed to replace the version line. Escaping single quotes for the sed command.
|
||||
sed -i "s/const VERSION = '.*';/const VERSION = '$NEW_VERSION';/" resources/js/pages/Settings.vue
|
||||
|
||||
- name: Generate production artifacts
|
||||
if: ${{ steps.release.outputs.pr }}
|
||||
run: npm run build
|
||||
|
||||
- name: Commit and push changes
|
||||
if: ${{ steps.release.outputs.pr }}
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "build: update production artifacts for ${{ fromJson(steps.release.outputs.pr).version }}"
|
||||
file_pattern: "resources/dist/* resources/js/pages/Settings.vue"
|
||||
# Ensure we push to the correct branch
|
||||
branch: ${{ fromJson(steps.release.outputs.pr).headBranchName }}
|
||||
32
.github/workflows/update-changelog.yml
vendored
32
.github/workflows/update-changelog.yml
vendored
@@ -1,32 +0,0 @@
|
||||
name: 'update-changelog'
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: base
|
||||
|
||||
- name: Update Changelog
|
||||
uses: stefanzweifel/changelog-updater-action@v1
|
||||
with:
|
||||
latest-version: ${{ github.event.release.name }}
|
||||
release-notes: ${{ github.event.release.body }}
|
||||
|
||||
- name: Commit updated CHANGELOG
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
branch: base
|
||||
commit_message: "chore: update `CHANGELOG`"
|
||||
file_pattern: CHANGELOG.md
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"version": "0.3.0-alpha",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"style:check": "eslint --config tools/eslint/.eslintrc.cjs --ignore-path tools/eslint/.eslintignore resources/js --ext .js,.ts,.vue",
|
||||
@@ -82,4 +83,4 @@
|
||||
"vue-codemirror": "^6.1.1",
|
||||
"vue-sonner": "^2.0.8"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ defineOptions({
|
||||
name: 'SettingsPage',
|
||||
});
|
||||
|
||||
const VERSION = 'v0.2.0-alpha';
|
||||
const VERSION = 'v0.3.0-alpha';
|
||||
|
||||
/*
|
||||
* Stores.
|
||||
|
||||
Reference in New Issue
Block a user