From 2ecb2aa531fc137a8dec60cdc67f3296ee69cbfb Mon Sep 17 00:00:00 2001 From: Younes Jaaidi Date: Tue, 14 Dec 2021 18:38:22 +0100 Subject: [PATCH] =?UTF-8?q?ci:=20=F0=9F=9B=A0=20use=20@jscutlery/devkit=20?= =?UTF-8?q?actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/release/action.yml | 35 ------------------------ .github/actions/setup/action.yml | 37 -------------------------- .github/workflows/nx-migrate.yml | 4 +-- .github/workflows/test-and-release.yml | 8 +++--- 4 files changed, 6 insertions(+), 78 deletions(-) delete mode 100644 .github/actions/release/action.yml delete mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml deleted file mode 100644 index c850e32ca..000000000 --- a/.github/actions/release/action.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Release - -description: Release packages - -inputs: - github_token: - description: GitHub token - required: true - npm_token: - description: NPM token - required: true - -runs: - using: composite - steps: - - name: Version - env: - NODE_AUTH_TOKEN: ${{ inputs.npm_token }} - # Use npx instead of yarn because yarn automagically sets NPM_* environment variables - # like NPM_CONFIG_REGISTRY so npm publish ends up ignoring the .npmrc file - # which is set up by `setup-node` action. - shell: bash - run: npx nx affected --base=last-release --target=version - - - name: Tag last-release - shell: bash - run: git tag -f last-release - - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ inputs.github_token }} - branch: ${{ github.ref }} - force: true - tags: true diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml deleted file mode 100644 index 558d4a0a1..000000000 --- a/.github/actions/setup/action.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Setup - -description: Setup Node.js, cache and install dependencies - -inputs: - node_version: - description: Node.js version - required: false - default: '16' - -runs: - using: composite - steps: - - name: Checkout all commits - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup git user to "🤖 JSCutlery Bot" - shell: bash - run: git config user.email "-" && git config user.name "🤖 JSCutlery Bot" - - - name: Use Node.js - uses: actions/setup-node@v2 - with: - cache: yarn - node-version: ${{ inputs.node_version }} - # This doesn't just set the registry url, but also sets - # the right configuration in .npmrc that reads NPM token - # from NPM_AUTH_TOKEN environment variable. - # It actually creates a .npmrc in a temporary folder - # and sets the NPM_CONFIG_USERCONFIG environment variable. - registry-url: https://registry.npmjs.org - - - name: yarn install - shell: bash - run: yarn --frozen-lockfile --no-progress --non-interactive --prefer-offline diff --git a/.github/workflows/nx-migrate.yml b/.github/workflows/nx-migrate.yml index 2954e752b..d59fb287c 100644 --- a/.github/workflows/nx-migrate.yml +++ b/.github/workflows/nx-migrate.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Setup - uses: ./.github/actions/setup + uses: jscutlery/devkit/.github/actions/setup@main - name: Check if @nrwl/workspace is outdated id: nrwl-workspace-outdated @@ -76,7 +76,7 @@ jobs: # events triggered by the GITHUB_TOKEN will not create a new workflow run. # This prevents you from accidentally creating recursive workflow runs."" - name: Release - uses: ./.github/actions/release + uses: jscutlery/devkit/.github/actions/release@main with: github_token: ${{ secrets.GITHUB_TOKEN }} npm_token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 7f838c7f1..9fbccb043 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -15,12 +15,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Setup - uses: ./.github/actions/setup + uses: jscutlery/devkit/.github/actions/setup@main with: node_version: ${{ matrix.node_version }} - name: Test - uses: ./.github/actions/test + uses: .github/actions/test with: codecov_token: ${{ secrets.CODECOV_TOKEN }} @@ -34,10 +34,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Setup - uses: ./.github/actions/setup + uses: jscutlery/devkit/.github/actions/setup@main - name: Release - uses: ./.github/actions/release + uses: jscutlery/devkit/.github/actions/release@main with: github_token: ${{ secrets.GITHUB_TOKEN }} npm_token: ${{ secrets.NPM_TOKEN }}