-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: split ci and publish workflows (#41)
- Loading branch information
1 parent
da2404f
commit f712142
Showing
3 changed files
with
46 additions
and
24 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 |
---|---|---|
@@ -1,41 +1,25 @@ | ||
name: Main CI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
distTag: | ||
description: "Dist tag to publish" | ||
required: true | ||
default: "latest" | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
build_and_testing: | ||
runs-on: ubuntu-latest | ||
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
always-auth: true | ||
cache: "yarn" | ||
node-version: 20 | ||
|
||
- name: Creates local .npmrc | ||
if: ${{github.event.inputs.distTag == 'latest'}} | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
|
||
- name: Install | ||
run: yarn install --frozen-lockfile | ||
|
||
|
@@ -46,10 +30,3 @@ jobs: | |
run: | | ||
yarn build | ||
yarn test | ||
- name: Release | ||
if: ${{github.event.inputs.distTag == 'latest'}} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Lingui CI" | ||
npm run release |
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,44 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
always-auth: true | ||
node-version: 20 | ||
cache: "yarn" | ||
scope: "@lingui" | ||
|
||
- name: Install & Build | ||
run: | | ||
yarn install --frozen-lockfile | ||
yarn build | ||
- name: Creates local .npmrc | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
|
||
- name: Prepare Lingui-Bot git account | ||
uses: oleksiyrudenko/gha-git-credentials@v2-latest | ||
with: | ||
name: "Lingui Bot" | ||
email: "[email protected]" | ||
actor: "lingui-bot" | ||
token: "${{ secrets.GH_TOKEN }}" | ||
|
||
- name: Release | ||
run: npm run release |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
dist | ||
.idea |