mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-17 01:56:00 +00:00
Automate and validate the release flow (#998)
* improve release flow * limit permission * Test and harden the release workflow * Keep workspace lockfile versions aligned * Run release regression tests in CI
This commit is contained in:
@@ -6,10 +6,26 @@ on:
|
||||
- '*' # Push events to matching any tag format, i.e. 1.0, 20.15.10
|
||||
- '!*-cli' # Exclude command-line interface tags
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Release tag to build
|
||||
required: true
|
||||
type: string
|
||||
draft:
|
||||
description: Create the GitHub Release as a draft
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
prerelease:
|
||||
description: Mark the GitHub Release as a pre-release
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
environment: release
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
@@ -19,6 +35,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
|
||||
submodules: recursive
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
@@ -27,7 +44,18 @@ jobs:
|
||||
- name: Get Version
|
||||
id: version
|
||||
run: |
|
||||
echo "tag=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT
|
||||
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||
TAG="${{ inputs.tag }}"
|
||||
DRAFT="${{ inputs.draft }}"
|
||||
PRERELEASE="${{ inputs.prerelease }}"
|
||||
else
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
DRAFT="true"
|
||||
PRERELEASE="false"
|
||||
fi
|
||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
echo "draft=${DRAFT}" >> $GITHUB_OUTPUT
|
||||
echo "prerelease=${PRERELEASE}" >> $GITHUB_OUTPUT
|
||||
# Build the plugin
|
||||
- name: Build
|
||||
id: build
|
||||
@@ -58,4 +86,5 @@ jobs:
|
||||
styles.css
|
||||
name: ${{ steps.version.outputs.tag }}
|
||||
tag_name: ${{ steps.version.outputs.tag }}
|
||||
draft: true
|
||||
draft: ${{ steps.version.outputs.draft }}
|
||||
prerelease: ${{ steps.version.outputs.prerelease }}
|
||||
|
||||
Reference in New Issue
Block a user