Create Release #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version Bump Type' | |
required: true | |
default: 'conventional' | |
type: choice | |
options: | |
- conventional | |
- patch | |
- minor | |
- major | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Setup Node.js with GitHub Packages | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: pnpm | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Install dependencies | |
run: pnpm install | |
# Needed because if only @framework changes, @core won't be built | |
# and the compilation of @framework will fail. | |
- name: Build core | |
run: pnpm --filter core run build | |
- name: Run versioning | |
run: | | |
git config --global user.email "${GIT_AUTHOR_EMAIL}" | |
git config --global user.name "${GIT_AUTHOR_NAME}" | |
pnpm run ci:version:${{ github.event.inputs.version }} | |
env: | |
GIT_AUTHOR_NAME: ${{ github.actor }} | |
GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release to GitHub Packages | |
run: | | |
git config --global user.email "${GIT_AUTHOR_EMAIL}" | |
git config --global user.name "${GIT_AUTHOR_NAME}" | |
pnpm run ci:publish:github | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_AUTHOR_NAME: ${{ github.actor }} | |
GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Node.js with NPM Registry | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Release to NPM Registry | |
run: | | |
echo "@nyx-discord:registry=https://registry.npmjs.org" >> .npmrc | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc | |
pnpm run ci:publish:npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |