chore(concourse-ts): update deps #313
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: npm-publish | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
determine-matrix: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
outputs: | |
affected: ${{ steps.affected.outputs.projects }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: lock-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
lock- | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.2.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: | | |
set -exu | |
yarn --frozen-lockfile --non-interactive | |
- uses: nrwl/nx-set-shas@v3 | |
- name: Determine affected packages | |
id: affected | |
run: | | |
set -exu | |
echo projects=$(yarn --silent nx print-affected | jq -c '.projects') >> $GITHUB_OUTPUT | |
lint: | |
name: lint-packages | |
runs-on: ubuntu-latest | |
needs: | |
- determine-matrix | |
if: ${{ needs.determine-matrix.outputs.affected != '[]' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: lock-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
lock- | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.2.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: | | |
set -exu | |
yarn --frozen-lockfile --non-interactive | |
- uses: nrwl/nx-set-shas@v3 | |
- run: yarn nx affected --target=lint | |
tests: | |
name: test-packages | |
runs-on: ubuntu-latest | |
needs: | |
- determine-matrix | |
if: ${{ needs.determine-matrix.outputs.affected != '[]' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: lock-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
lock- | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.2.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: | | |
set -exu | |
yarn --frozen-lockfile --non-interactive | |
- uses: nrwl/nx-set-shas@v3 | |
- run: yarn nx affected --target=test | |
docs: | |
name: build-docs | |
runs-on: ubuntu-latest | |
needs: | |
- determine-matrix | |
if: ${{ needs.determine-matrix.outputs.affected != '[]' }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: lock-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
lock- | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.2.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: | | |
set -exu | |
yarn --frozen-lockfile --non-interactive | |
- name: Generate docs | |
run: | | |
set -exu | |
yarn docs | |
- name: Push to wiki repository | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.WIKI_PAT }} | |
with: | |
source-directory: 'docs' | |
destination-github-username: 'DecentM' | |
destination-repository-name: 'concourse-ts.wiki' | |
user-email: 41898282+github-actions[bot]@users.noreply.github.com | |
target-branch: master | |
build: | |
name: build-packages | |
runs-on: ubuntu-latest | |
needs: | |
- determine-matrix | |
if: ${{ needs.determine-matrix.outputs.affected != '[]' }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Cache | |
uses: actions/cache@v3 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: lock-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
lock- | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.2.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: | | |
set -exu | |
yarn --frozen-lockfile --non-interactive | |
- uses: nrwl/nx-set-shas@v3 | |
- name: Build packages | |
run: yarn nx affected --target=build | |
- name: Upload build result | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist/packages/* | |
publish: | |
name: publish-${{ matrix.project }} | |
needs: | |
- determine-matrix | |
- lint | |
- tests | |
- build | |
- docs | |
runs-on: ubuntu-latest | |
if: ${{ needs.determine-matrix.outputs.affected != '[]' }} | |
strategy: | |
matrix: | |
project: ${{ fromJson(needs.determine-matrix.outputs.affected) }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Compare npm with local (versions) | |
id: check | |
uses: EndBug/version-check@v2 | |
with: | |
file-url: https://unpkg.com/@decentm/${{ matrix.project }}@latest/package.json | |
static-checking: localIsNew | |
file-name: ./dist/${{ matrix.project }}/package.json | |
- name: Setup Node | |
if: steps.check.outputs.changed == 'true' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.2.x' | |
registry-url: 'https://registry.npmjs.org' | |
# Publish new versions of affected packages | |
- name: Publish to NPM | |
if: steps.check.outputs.changed == 'true' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
set -exu | |
cd dist/${{ matrix.project }} | |
yarn publish . --access public | |
cd - |