ci: update badges #138
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: ci | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ci | |
cancel-in-progress: false | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
packages: ${{ steps.packages.outputs.packages }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: packages | |
shell: bash | |
run: | | |
PACKAGES_LIST=$(find . -mindepth 2 -maxdepth 2 -type f -name deno.jsonc -exec bash -c 'basename $(dirname {})' \;) | |
PACKAGES_LIST_JSON=$(echo "$PACKAGES_LIST" | jq --raw-input --compact-output --slurp 'split("\n")[:-1]') | |
echo "packages: $PACKAGES_LIST_JSON" | |
echo "packages=$PACKAGES_LIST_JSON" >> $GITHUB_OUTPUT | |
test: | |
runs-on: ubuntu-latest | |
needs: | |
- setup | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{fromJson(needs.setup.outputs.packages)}} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: 1.x | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: 1.x | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- run: deno task ${{ matrix.package }}:ci | |
coverage: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: | |
- setup | |
- test | |
environment: | |
name: github-pages | |
url: ${{ steps.pages.outputs.page_url }} | |
permissions: | |
id-token: write | |
contents: read | |
pages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/configure-pages@v5 | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: 1.x | |
- run: deno task coverage | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: coverage | |
- id: pages | |
uses: actions/deploy-pages@v4 | |
tag: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: | |
- setup | |
- test | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{fromJson(needs.setup.outputs.packages)}} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: tagging | |
uses: ldelarue/[email protected] | |
with: | |
tag-prefix: ${{ matrix.package }}- | |
scope: ${{ matrix.package }} | |
- uses: denoland/setup-deno@v1 | |
- if: ${{ steps.tagging.outputs.tag }} | |
shell: bash | |
run: | | |
deno task tag --version '${{ steps.tagging.outputs.semver }}' ${{ matrix.package }} | |
deno fmt ${{ matrix.package }}/deno.jsonc | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git tag '${{ steps.tagging.outputs.tag }}' | |
git show-ref --tags '${{ steps.tagging.outputs.tag }}' | |
git push origin '${{ steps.tagging.outputs.tag }}' | |
git pull --ff-only | |
git add ${{ matrix.package }}/deno.jsonc | |
git commit -m "chore: bump version ${{ steps.tagging.outputs.tag }}" | |
git push | |
publish: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: | |
- setup | |
- test | |
- tag | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{fromJson(needs.setup.outputs.packages)}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
- uses: denoland/setup-deno@v1 | |
- run: deno task ${{ matrix.package }}:publish | |