chore(dfx-qrcode): release version 4.0.0 #1417
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: on branch push | |
on: | |
pull_request: | |
push: | |
branches: | |
- '*' # matches every branch that doesn't contain a '/' | |
- '*/*' # matches every branch containing a single '/' | |
- '**' # matches every branch | |
# This allows a subsequently queued workflow run to interrupt previous runs | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
prettier: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: dafnik/setup-node-pnpm@v3 | |
with: | |
install-ignore-scripts: true | |
- name: Style check | |
run: pnpm format:check | |
eslint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: dafnik/setup-node-pnpm@v3 | |
with: | |
install-ignore-scripts: true | |
- name: Lint project | |
run: pnpm lint:check | |
commitlint: | |
name: Commitlint Check | |
runs-on: ubuntu-latest | |
steps: | |
# Needed to get the commitlint config | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Run commitlint | |
uses: dafnik/commitlint@v1 | |
# JOB to run change detection | |
changes: | |
runs-on: ubuntu-latest | |
# Required permissions | |
permissions: | |
pull-requests: read | |
outputs: | |
# Expose matched filters as job 'packages' output variable | |
libs: ${{ steps.filter.outputs.changes }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
dfts-helper: | |
- 'libs/dfts-helper/**' | |
- '{package,nx,migrations,tsconfig.base}.json' | |
- 'pnpm-lock.yaml' | |
- '.github/**' | |
dfts-qrcode: | |
- 'libs/dfts-qrcode/**' | |
- '{package,nx,migrations,tsconfig.base}.json' | |
- 'pnpm-lock.yaml' | |
- '.github/**' | |
dfx-bootstrap-table: | |
- 'libs/dfx-bootstrap-table/**' | |
- '{package,nx,migrations,tsconfig.base}.json' | |
- 'pnpm-lock.yaml' | |
- '.github/**' | |
dfx-helper: | |
- 'libs/dfx-helper/**' | |
- '{package,nx,migrations,tsconfig.base}.json' | |
- 'pnpm-lock.yaml' | |
- '.github/**' | |
dfx-qrcode: | |
- 'libs/dfx-qrcode/**' | |
- '{package,nx,migrations,tsconfig.base}.json' | |
- 'pnpm-lock.yaml' | |
- '.github/**' | |
dfx-bootstrap-icons: | |
- 'libs/dfx-bootstrap-icons/**' | |
- '{package,nx,migrations,tsconfig.base}.json' | |
- 'pnpm-lock.yaml' | |
- '.github/**' | |
dfx-openapi: | |
- 'libs/dfx-openapi/**' | |
- '{package,nx,migrations,tsconfig.base}.json' | |
- 'pnpm-lock.yaml' | |
- '.github/**' | |
test: | |
name: Test ${{ matrix.lib }} | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
needs: changes | |
if: ${{ needs.changes.outputs.libs != '[]' && needs.changes.outputs.libs != '' }} | |
strategy: | |
matrix: | |
lib: ${{ fromJSON(needs.changes.outputs.libs) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup node and pnpm | |
uses: dafnik/setup-node-pnpm@v3 | |
with: | |
install-ignore-scripts: true | |
- name: test ${{ matrix.lib }} | |
run: pnpm exec nx test ${{ matrix.lib }} --configuration=ci --coverageReporters=cobertura | |
- name: setup coverage report | |
uses: ./.github/actions/setup-coverage-report | |
with: | |
path: coverage/libs/${{ matrix.lib }}/cobertura-coverage.xml | |
build-lib: | |
name: Build ${{ matrix.lib }} | |
runs-on: ubuntu-latest | |
needs: changes | |
if: ${{ needs.changes.outputs.libs != '[]' && needs.changes.outputs.libs != '' }} | |
strategy: | |
matrix: | |
lib: ${{ fromJSON(needs.changes.outputs.libs) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup node and pnpm | |
uses: dafnik/setup-node-pnpm@v3 | |
with: | |
install-ignore-scripts: true | |
- name: build ${{ matrix.lib }} | |
run: pnpm exec nx build ${{ matrix.lib }} | |
- name: zip ${{ matrix.lib }} | |
run: | | |
cd ./dist/libs/ | |
zip -r "${{ matrix.lib }}.zip" ./${{ matrix.lib }} | |
cd - | |
- uses: actions/upload-artifact@v4 | |
name: create ${{ matrix.lib }} artifact | |
with: | |
name: ${{ matrix.lib }} | |
path: ./dist/libs/${{ matrix.lib }}.zip | |
retention-days: 1 | |
build-apps: | |
name: Build ${{ matrix.app }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
app: ['dfx-bootstrap-table-demo', 'dfx-bootstrap-icons-demo', 'dfx-qrcode-demo', 'playground'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup node and pnpm | |
uses: dafnik/setup-node-pnpm@v3 | |
with: | |
install-ignore-scripts: true | |
- name: build ${{ matrix.app }} | |
run: pnpm exec nx build ${{ matrix.app }} | |
- name: zip ${{ matrix.app }} | |
run: | | |
cd ./dist/apps/ | |
zip -r "${{ matrix.app }}.zip" ./${{ matrix.app }} | |
cd - | |
- uses: actions/upload-artifact@v4 | |
name: create ${{ matrix.app }} artifact | |
with: | |
name: ${{ matrix.app }} | |
path: ./dist/apps/${{ matrix.app }}.zip | |
retention-days: 1 | |
bundle-apps: | |
name: Bundle app artifacts into one | |
needs: [build-apps] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
name: Download table-demo | |
with: | |
name: dfx-bootstrap-table-demo | |
- uses: actions/download-artifact@v4 | |
name: Download icons-demo | |
with: | |
name: dfx-bootstrap-icons-demo | |
- uses: actions/download-artifact@v4 | |
name: Download qrcode-demo | |
with: | |
name: dfx-qrcode-demo | |
- uses: actions/download-artifact@v4 | |
name: Download playground | |
with: | |
name: playground | |
- name: unzip all | |
run: | | |
unzip dfx-bootstrap-table-demo.zip | |
unzip dfx-bootstrap-icons-demo.zip | |
unzip dfx-qrcode-demo.zip | |
unzip playground.zip | |
- name: move files in place | |
run: | | |
mkdir dist | |
mkdir dist/bootstrap-table | |
mkdir dist/bootstrap-icons | |
mkdir dist/qrcode | |
mv playground/browser/* dist/ | |
mv dfx-bootstrap-table-demo/browser/* dist/bootstrap-table/ | |
mv dfx-bootstrap-icons-demo/browser/* dist/bootstrap-icons/ | |
mv dfx-qrcode-demo/browser/* dist/qrcode/ | |
- name: dist lookup | |
run: | | |
cd dist | |
ls -la | |
du -hs | |
cd - | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist/ | |
retention-days: 1 | |
deploy-apps: | |
if: github.ref == 'refs/heads/main' | |
name: Deploy apps | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: bundle-apps | |
permissions: | |
actions: read | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |