Skip to content

Commit

Permalink
chore: add workflow updates
Browse files Browse the repository at this point in the history
  • Loading branch information
palashmon committed May 3, 2024
1 parent 47df1e5 commit eab0ed3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 40 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/auto-approve.yml

This file was deleted.

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

on:
schedule:
- cron: '30 2 * * 5' # Weekly
workflow_dispatch: # manual trigger

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
packages: write
pull-requests: write

jobs:
call-workflow:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
uses: palashmon/reusable-workflows/.github/workflows/gh-release.yml@main
40 changes: 9 additions & 31 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Publish Package to Npmjs

name: Publish NPM Release
on:
release:
types: [published]

workflow_run:
workflows: ["GitHub Release"]
types: [completed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "20.x"
- run: npm i
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: npm i
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: palashmon/reusable-workflows/.github/workflows/npm-publish.yml@main
secrets: inherit
with:
build-needed: true

0 comments on commit eab0ed3

Please sign in to comment.