From 82e6805d0333849645c9eabd4694f7c4eda509af Mon Sep 17 00:00:00 2001 From: Mateusz Duda Date: Thu, 11 Apr 2024 13:06:25 +0200 Subject: [PATCH] updated workflows --- .github/workflows/publish-package-to-npm.yml | 18 ++++++++++-------- .github/workflows/run-unit-tests.yml | 2 +- README.md | 1 - 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-package-to-npm.yml b/.github/workflows/publish-package-to-npm.yml index 40c2767..a8fe6c5 100644 --- a/.github/workflows/publish-package-to-npm.yml +++ b/.github/workflows/publish-package-to-npm.yml @@ -7,15 +7,15 @@ on: - 'main' jobs: test: - name: Build & Test + name: Publish package to npm runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x, 14.x] + node-version: [12.16.1] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Cache node_modules @@ -33,9 +33,9 @@ jobs: name: Publish needs: test runs-on: ubuntu-latest - if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' ) + if: github.event_name == 'push' && ( github.ref == 'refs/heads/main' ) steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache node_modules id: cache-modules uses: actions/cache@v1 @@ -51,5 +51,7 @@ jobs: - name: Publish uses: mikeal/merge-release@master env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + DEPLOY_DIR: my/deploy/dir + SRC_PACKAGE_DIR: my/src/package \ No newline at end of file diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index 7939b94..5305cb0 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -1,5 +1,5 @@ -on: [push] name: Tests +on: [push] run-name: ${{ github.event.head_commit.message }} jobs: run-tests: diff --git a/README.md b/README.md index 1305739..116420c 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,6 @@ For unit testing there is a [separate mock repository](https://www.npmjs.com/pac - [ ] Unit tests for common actions: - [ ] Testing if files are correstly updated in database depending on changes in git - [ ] On loading `tags.json` assert that all parents exist in database, if not then these modules won't be displayed -- [ ] Add [np package](https://www.npmjs.com/package/np) to handle publishing to npm - giga optional - [ ] Add [automatic publish to npm](https://github.com/marketplace/actions/automated-releases-for-npm-packages) as github action (if tests passed) ### To be discussed