mirror of
https://github.com/garronej/ts-ci.git
synced 2025-11-30 21:43:05 +00:00
Yarn support
This commit is contained in:
parent
aa614f4e28
commit
7e7edd6258
4 changed files with 39 additions and 16 deletions
29
.github/workflows/ci.yaml
vendored
29
.github/workflows/ci.yaml
vendored
|
|
@ -30,15 +30,28 @@ jobs:
|
||||||
os: [ windows-latest, ubuntu-latest ]
|
os: [ windows-latest, ubuntu-latest ]
|
||||||
name: Test with Node v${{ matrix.node }} on ${{ matrix.os }}
|
name: Test with Node v${{ matrix.node }} on ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Tell if project is using npm or yarn
|
||||||
|
id: _1
|
||||||
|
uses: garronej/github_actions_toolkit@v1.11
|
||||||
|
with:
|
||||||
|
action_name: tell_if_project_uses_npm_or_yarn
|
||||||
|
owner: ${{github.repository_owner}}
|
||||||
|
repo: ${{github.event.repository.name}}
|
||||||
|
branch: ${{github.ref}}
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
- run: npm ci
|
- if: steps._1.npm_or_yarn == 'yarn'
|
||||||
- run: npm run build
|
run: |
|
||||||
- run: npm run test
|
yarn install --frozen-lockfile
|
||||||
|
yarn run build
|
||||||
|
yarn run test
|
||||||
|
- if: steps._1.npm_or_yarn == 'npm'
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npm run build
|
||||||
|
npm run test
|
||||||
trigger_publish:
|
trigger_publish:
|
||||||
name: Trigger publish.yaml workflow if package.json version updated ( and secrets.PAT is set ).
|
name: Trigger publish.yaml workflow if package.json version updated ( and secrets.PAT is set ).
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -50,7 +63,7 @@ jobs:
|
||||||
|
|
||||||
- name: Get version on latest
|
- name: Get version on latest
|
||||||
id: v_latest
|
id: v_latest
|
||||||
uses: garronej/github_actions_toolkit@v1.9
|
uses: garronej/github_actions_toolkit@v1.11
|
||||||
with:
|
with:
|
||||||
action_name: get_package_json_version
|
action_name: get_package_json_version
|
||||||
owner: ${{github.repository_owner}}
|
owner: ${{github.repository_owner}}
|
||||||
|
|
@ -60,7 +73,7 @@ jobs:
|
||||||
|
|
||||||
- name: Get version on develop
|
- name: Get version on develop
|
||||||
id: v_develop
|
id: v_develop
|
||||||
uses: garronej/github_actions_toolkit@v1.9
|
uses: garronej/github_actions_toolkit@v1.11
|
||||||
with:
|
with:
|
||||||
action_name: get_package_json_version
|
action_name: get_package_json_version
|
||||||
owner: ${{github.repository_owner}}
|
owner: ${{github.repository_owner}}
|
||||||
|
|
@ -70,7 +83,7 @@ jobs:
|
||||||
|
|
||||||
- name: 'Trigger the ''publish'' workflow'
|
- name: 'Trigger the ''publish'' workflow'
|
||||||
if: ${{ !!env.PAT && steps.v_develop.outputs.compare_result == '1' }}
|
if: ${{ !!env.PAT && steps.v_develop.outputs.compare_result == '1' }}
|
||||||
uses: garronej/github_actions_toolkit@v1.9
|
uses: garronej/github_actions_toolkit@v1.11
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
18
.github/workflows/publish.yaml
vendored
18
.github/workflows/publish.yaml
vendored
|
|
@ -8,7 +8,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Synchronize package.json and package-lock.json version if needed.
|
- name: Synchronize package.json and package-lock.json version if needed.
|
||||||
uses: garronej/github_actions_toolkit@v1.9
|
uses: garronej/github_actions_toolkit@v1.11
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
with:
|
with:
|
||||||
|
|
@ -19,7 +19,7 @@ jobs:
|
||||||
commit_author_email: ts_ci@github.com
|
commit_author_email: ts_ci@github.com
|
||||||
- name: Update CHANGELOG.md
|
- name: Update CHANGELOG.md
|
||||||
if: ${{ !!github.event.client_payload.from_version }}
|
if: ${{ !!github.event.client_payload.from_version }}
|
||||||
uses: garronej/github_actions_toolkit@v1.9
|
uses: garronej/github_actions_toolkit@v1.11
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
with:
|
with:
|
||||||
|
|
@ -51,8 +51,18 @@ jobs:
|
||||||
git branch latest
|
git branch latest
|
||||||
git checkout latest
|
git checkout latest
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
- run: npm ci
|
- run: |
|
||||||
- run: npm run enable_short_import_path
|
if [ -f "./yarn.lock" ]; then
|
||||||
|
yarn install --frozen-lockfile
|
||||||
|
else
|
||||||
|
npm ci
|
||||||
|
fi
|
||||||
|
- run: |
|
||||||
|
PACKAGE_MANAGER=npm
|
||||||
|
if [ -f "./yarn.lock" ]; then
|
||||||
|
PACKAGE_MANAGER=yarn
|
||||||
|
fi
|
||||||
|
$PACKAGE_MANAGER run enable_short_import_path
|
||||||
env:
|
env:
|
||||||
DRY_RUN: "0"
|
DRY_RUN: "0"
|
||||||
- name: (DEBUG) Show how the files have been moved to enable short import
|
- name: (DEBUG) Show how the files have been moved to enable short import
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
name: template_initialization
|
name: template_initialization
|
||||||
on:
|
on:
|
||||||
create:
|
create
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
template_initialization:
|
template_initialization:
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
NEW: `yarn` support ✅ You are now free to use yarn instead of `npm` if you'd like to.
|
||||||
|
|
||||||
⚠WARNING⚠: There is currently a problem with the initialization workflow that does not trigger automatically.
|
⚠WARNING⚠: There is currently a problem with the initialization workflow that does not trigger automatically.
|
||||||
I am trying to adress the problem but for now the workaround is to manually edit `.github/workflow/template_initialization.yaml`
|
I am trying to adress the problem but for now the workaround is to manually edit `.github/workflow/template_initialization.yaml`
|
||||||
and replace:
|
and replace:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue