-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(release): separate prerequisites step, use composite actions, fix …
…condition for npmrc setup (#1951)
- Loading branch information
1 parent
6fcad15
commit 8df6827
Showing
3 changed files
with
55 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: "Git credentials setup" | ||
description: "Set up git credentials" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up git credentials | ||
shell: bash | ||
run: | | ||
git config --global user.name 'ci' | ||
git config --global user.email '[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,37 +3,54 @@ name: Release new version | |
on: workflow_dispatch | ||
|
||
jobs: | ||
prerequisites: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- name: "Test" | ||
command: "test" | ||
- name: "Lint" | ||
command: "lint" | ||
- name: "Stylelint" | ||
command: "stylelint" | ||
- name: "Build" | ||
command: "build" | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Run Setup | ||
uses: ./.github/actions/setup | ||
with: | ||
npm_token: ${{secrets.npm_token}} | ||
- name: Run ${{matrix.name}} | ||
shell: bash | ||
run: yarn lerna run ${{matrix.command}} --since | ||
release: | ||
needs: prerequisites | ||
runs-on: ubuntu-latest | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v4 | ||
- name: Run Setup | ||
uses: ./.github/actions/setup | ||
with: | ||
node-version-file: ".nvmrc" | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install | ||
run: yarn | ||
- name: Lint | ||
run: yarn lerna run lint --since | ||
- name: Build | ||
run: yarn lerna run build --since | ||
- name: Test | ||
run: yarn lerna run test --since | ||
- name: Set up git credentials | ||
run: | | ||
git config --global user.name 'ci' | ||
git config --global user.email '[email protected]' | ||
npm_token: ${{secrets.npm_token}} | ||
- uses: ./.github/actions/git-creds | ||
- name: Generate new versions | ||
run: yarn lerna version --conventional-commits -y | ||
- run: yarn config set registry https://registry.npmjs.org/ | ||
- name: Setup .npmrc for publish | ||
id: setup-npmrc | ||
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc | ||
- name: Publish to npm | ||
run: yarn lerna publish from-package -y | ||
- name: Remove .npmrc | ||
if: success() || failure() | ||
if: steps.setup-npmrc.outcome == 'success' | ||
run: rm .npmrc |