Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workflows): switch to an integrated release-and-publish workflow #10

Merged
merged 1 commit into from
Nov 28, 2023
Merged
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
49 changes: 0 additions & 49 deletions .github/workflows/publish-please.yml

This file was deleted.

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

on:
workflow_call:
secrets:
READONLY_NPM_TOKEN:
description: Needed to install private @hedia npm packages
required: true
PUBLISHING_NPM_TOKEN:
description: Needed to publish @hedia npm packages
required: true

permissions:
contents: write
pull-requests: write

jobs:
release-and-publish:
runs-on: ubuntu-latest
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'autorelease: pending')
)
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node

- if: steps.release.outputs.release_created == 'true'
name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
fetch-depth: 1

- if: steps.release.outputs.release_created == 'true'
name: Setup Node.js Environment
uses: actions/setup-node@v3
with:
node-version-file: "package.json"
always-auth: true
registry-url: https://registry.npmjs.org
scope: "@hedia"

- if: steps.release.outputs.release_created == 'true'
name: Install Dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READONLY_NPM_TOKEN }}

- if: steps.release.outputs.release_created == 'true'
name: Build
run: npm run build --if-present

- if: steps.release.outputs.release_created == 'true'
name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.PUBLISHING_NPM_TOKEN }}
22 changes: 0 additions & 22 deletions .github/workflows/release-please.yml

This file was deleted.