106 lines
3.1 KiB
YAML
106 lines
3.1 KiB
YAML
name: 🚀 Release
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
package:
|
|
description: Package to release
|
|
default: wxt
|
|
type: choice
|
|
options:
|
|
- analytics
|
|
- auto-icons
|
|
- i18n
|
|
- is-background
|
|
- module-react
|
|
- module-solid
|
|
- module-svelte
|
|
- module-vue
|
|
- runner
|
|
- storage
|
|
- unocss
|
|
- webextension-polyfill
|
|
- wxt
|
|
bump:
|
|
description: Blank (auto), a version (1.4.1), or major/minor/patch
|
|
type: string
|
|
dryRun:
|
|
description: Do a dry-run and don't publish anything
|
|
type: boolean
|
|
default: false
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
validate:
|
|
name: Validate
|
|
uses: './.github/workflows/validate.yml'
|
|
secrets: inherit
|
|
if: ${{ inputs.dryRun != true }}
|
|
|
|
publish:
|
|
name: Publish ${{ case(inputs.dryRun, ' (dry-run)', '') }}
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: write # Push version changes
|
|
id-token: write # OIDC for NPM publishing
|
|
needs:
|
|
- validate
|
|
# Allow dry runs to skip validation but still run this job
|
|
if: |
|
|
always() &&
|
|
(needs.validate.result == 'success' || needs.validate.result == 'skipped')
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
ssh-key: ${{ secrets.DEPLOY_KEY }} # https://github.com/sbellone/release-workflow-example
|
|
|
|
- name: Setup
|
|
uses: ./.github/actions/setup
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config user.name 'github-actions[bot]'
|
|
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
|
|
|
- name: Upgrade NPM for Provence
|
|
run: sudo npm i -g npm@latest
|
|
|
|
- name: Bump and Release
|
|
uses: aklinker1/zero-changelog/actions/release@b6fcca17cebfc45f996b80fe5926da924d8441f8 # 0.2.1
|
|
with:
|
|
bump: ${{ inputs.bump }}
|
|
path: packages/${{ inputs.package }}
|
|
# Include documentation updates in WXT's releases
|
|
additionalDirs: |-
|
|
${{ case(
|
|
inputs.package == 'wxt', 'docs',
|
|
''
|
|
) }}
|
|
# Use package name in commit message
|
|
commitTemplate: |-
|
|
${{ case(
|
|
inputs.package == 'wxt', 'chore(release): wxt v{{version}}',
|
|
'chore(release): @wxt-dev/{{dirname}} v{{version}}'
|
|
) }}
|
|
# Use package name in release name
|
|
releaseNameTemplate: |-
|
|
${{ case(
|
|
inputs.package == 'wxt', 'wxt v{{version}}',
|
|
'@wxt-dev/{{dirname}} v{{version}}'
|
|
) }}
|
|
# Update lockfile with new versions since it includes the package versions
|
|
preCommitCommands: |-
|
|
bun i
|
|
publishCommands: |-
|
|
bun pm pack
|
|
npm publish *.tgz
|
|
dryRun: ${{ inputs.dryRun }}
|
|
dryRunPublishCommands: |-
|
|
bun pm pack
|
|
npm publish *.tgz --dry-run
|
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
latestRelease: ${{ inputs.package == 'wxt' }}
|