mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
* ci: better release workflow * ci: simplify + use changelog * ci(release): better parsing and exclusions * ci(release): remove tree log * ci(release): improve logs * ci(release): properly check inputs * ci(release): better promise handling Co-authored-by: Aura <kyradiscord@gmail.com> * ci: refactor release to use bun * ci(release): whitespace Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> * ci(release): add dev release handling * ci(release): fixes from testing * ci(release): make the promise run * ci(release): when specifying package, skip exclusions * ci(dev): create-discord-bot dev release * ci(release): improve changelog detection * ci: fix typo and allow releasing branches * ci(release): set make_latest for gh releases * ci(release): add ssh_key so pushed tags run workflow --------- Co-authored-by: Aura <kyradiscord@gmail.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
76 lines
2.1 KiB
YAML
76 lines
2.1 KiB
YAML
name: Release
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: 'The branch, tag or SHA to checkout'
|
|
required: true
|
|
default: 'main'
|
|
package:
|
|
description: 'The published name of a single package to release'
|
|
type: choice
|
|
required: false
|
|
options:
|
|
- all
|
|
- discord.js
|
|
- '@discordjs/brokers'
|
|
- '@discordjs/builders'
|
|
- '@discordjs/collection'
|
|
- '@discordjs/core'
|
|
- 'create-discord-bot'
|
|
- '@discordjs/docgen'
|
|
- '@discordjs/formatters'
|
|
- '@discordjs/next'
|
|
- '@discordjs/proxy'
|
|
- '@discordjs/rest'
|
|
- '@discordjs/util'
|
|
- '@discordjs/voice'
|
|
- '@discordjs/ws'
|
|
exclude:
|
|
description: 'Comma separated list of packages to exclude from release (if not depended upon)'
|
|
required: false
|
|
type: string
|
|
default: '@discordjs/docgen,@discordjs/next'
|
|
dry_run:
|
|
type: boolean
|
|
default: false
|
|
jobs:
|
|
npm-publish:
|
|
name: npm publish
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
contents: write
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
if: github.repository_owner == 'discordjs'
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ inputs.ref || '' }}
|
|
ssh_key: ${{ secrets.DEPLOY_KEY_CI_RELEASE_TAGS }}
|
|
|
|
- name: Install Node.js v20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
registry-url: https://registry.npmjs.org/
|
|
|
|
- name: Install dependencies
|
|
uses: ./packages/actions/src/pnpmCache
|
|
|
|
- name: Build dependencies
|
|
run: pnpm run build
|
|
|
|
- name: Release packages
|
|
uses: ./packages/actions/src/releasePackages
|
|
with:
|
|
package: ${{ inputs.package }}
|
|
exclude: ${{ inputs.exclude }}
|
|
dry: ${{ inputs.dry_run }}
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|