feat: initial commit #1
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
name: Publish libs | |
on: | |
push: | |
branches: | |
- main | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get tags | |
run: git fetch --tags origin | |
- name: Enable Corepack (for Yarn v4) | |
run: corepack enable | |
- name: Prepare Corepack Yarn v4 | |
run: corepack prepare [email protected] --activate | |
- name: Get Yarn cache directory | |
id: yarn-cache-dir | |
shell: bash | |
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT} | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
cache-dependency-path: yarn.lock | |
- name: Cache Yarn modules | |
id: cache-yarn | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarn-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }} | |
name: List the state of Yarn modules | |
continue-on-error: true | |
run: yarn list | |
- name: Init git | |
run: | | |
git config --global user.name 'Safe angular Action' | |
git config --global user.email '[email protected]' | |
- name: Install dependencies with Yarn v4 | |
run: yarn install | |
- name: Version | |
run: | | |
echo "Checking for affected libraries and updating versions..." | |
npx nx affected --base=HEAD~1 --target=version --parallel=1 || exit 1 | |
- name: Commit | |
uses: ./.github/actions/commit-and-push-changes | |
if: success() | |
continue-on-error: true |