From b4b41a90564264802d746129afebefb14cee496c Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen <11024+ivuorinen@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:02:49 +0300 Subject: [PATCH] Workflow changes (#269) * feat(workflows): pr actions workflow * fix(workflows): split version bump and publish --- .github/workflows/pr.yml | 52 +++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 15 +++++++--- 2 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..1b2076f --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,52 @@ +--- +name: PR Actions + +on: + pull_request: + +permissions: + contents: write + issues: write + pull-requests: write + +jobs: + pr: + name: PR Actions + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4.1.7 + with: + fetch-depth: 0 + + - name: Setup Node.js Environment + uses: actions/setup-node@v4.0.2 + with: + always-auth: true + node-version: 20 + registry-url: 'https://registry.npmjs.org' + scope: '@ivuorinen' + + - name: Cache Node Modules + uses: actions/cache@v4.0.2 + id: cache + with: + path: node_modules + key: node-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: yarn install + + - name: Yarn Lock Changes + # Please use `main` as version before the stable release will be published as `v1`. + uses: Simek/yarn-lock-changes@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + # Optional inputs, can be deleted safely if you are happy with default values. + collapsibleThreshold: 25 + failOnDowngrade: false + path: yarn.lock + updateComment: true + groupByType: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 27a9347..c34b5a2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,10 +48,17 @@ jobs: - name: Bootstrap Lerna run: yarn lerna:bootstrap:ci - - name: Bump Versions and Publish Packages + - name: Bump Versions env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - yarn lerna:version - yarn lerna:publish + run: yarn lerna:version + + - name: Auto Commit Changes + uses: stefanzweifel/git-auto-commit-action@v5 + + - name: Publish Packages + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: yarn lerna:publish