Skip to content

ci: set publish-branch #127

ci: set publish-branch

ci: set publish-branch #127

Workflow file for this run

name: 🦋 Changesets Release
on:
push:
branches:
- release
- "release-*"
- "!release-experimental"
- "!release-experimental-*"
- "!release-manual"
- "!release-manual-*"
permissions:
id-token: write
pull-requests: write
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: 🦋 Changesets Release
if: github.repository == 'mcansh/remix-fastify'
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Enable corepack
run: corepack enable
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: 🟧 Install dependencies
run: pnpm install --recursive --frozen-lockfile --strict-peer-dependencies
- name: 🔐 Setup npm auth
run: |
echo "registry=https://registry.npmjs.org" >> ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- name: 🟧 Set publish-branch to current branch
run: |
echo "publish-branch=$(git branch --show-current)" >> ~/.npmrc
# This action has two responsibilities. The first time the workflow runs
# (initial push to a `release-*` branch) it will create a new branch and
# then open a PR with the related changes for the new version. After the
# PR is merged, the workflow will run again and this action will build +
# publish to npm & github packages.
- name: 🚀 PR / Publish
id: changesets
uses: changesets/action@v1
with:
version: pnpm run changeset:version
commit: "chore: Update version for release"
title: "chore: Update version for release"
publish: pnpm run changeset:release
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
comment:
name: 📝 Comment on issues and pull requests
if: github.repository == 'mcansh/remix-fastify' && needs.release.outputs.published == 'true'
needs: [release]
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 📝 Comment on issues
uses: remix-run/release-comment-action@v0.4.1
with:
DIRECTORY_TO_CHECK: "./packages"
PACKAGE_NAME: "@mcansh/remix-fastify"