Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ lint-staged.config.js
jest.config.js
babel.config.js
plopfile.mjs
release.config.js
coverage/
dist/
docs/
Expand Down
62 changes: 0 additions & 62 deletions .github/release-please-config.json

This file was deleted.

3 changes: 0 additions & 3 deletions .github/release-please-manifest.json

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/publish.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/release-please.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Release

on:
push:
branches:
- main

permissions:
# Enable `semantic-release` to publish a GitHub release and push commits
contents: write
# Enable `semantic-release` to post comments on issues
issues: write
# Enable `semantic-release` to post comments on pull requests
pull-requests: write
# Enable the use of OIDC for trusted publishing and npm provenance
id-token: write
# Enable the use of GitHub Packages registry
packages: write

# Release involves crucial steps that shouldn't be cancelled mid-run,
# so new workflow runs are queued until the previous one finishes.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_REPO_TOKEN }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
scope: '@doist'
registry-url: 'https://registry.npmjs.org/'

- name: Install dependencies
run: npm ci

- name: Capture previous tag
id: previous_tag
run: echo "tag=$(git describe --tags --abbrev=0 2>/dev/null || true)" >> "$GITHUB_OUTPUT"

- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
GIT_AUTHOR_EMAIL: doistbot@users.noreply.github.com
GIT_AUTHOR_NAME: Doist Bot
GIT_COMMITTER_EMAIL: doistbot@users.noreply.github.com
GIT_COMMITTER_NAME: Doist Bot

- name: Check if release was created
id: check_release
env:
PREVIOUS_TAG: ${{ steps.previous_tag.outputs.tag }}
run: |
git fetch --force --tags origin
new_tag="$(git describe --tags --abbrev=0 2>/dev/null || true)"
if [ -z "${new_tag}" ] || [ "${new_tag}" = "${PREVIOUS_TAG}" ]; then
echo "released=false" >> "$GITHUB_OUTPUT"
else
echo "released=true" >> "$GITHUB_OUTPUT"
fi

- name: Remove Doist registry configuration from .npmrc
if: ${{ steps.check_release.outputs.released == 'true' }}
run: npm config delete @doist:registry --location=project

- name: Prepare Node.js environment for GitHub Packages registry
if: ${{ steps.check_release.outputs.released == 'true' }}
uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: https://npm.pkg.github.com/
scope: '@doist'

- name: Publish package to GitHub Packages registry
if: ${{ steps.check_release.outputs.released == 'true' }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading