Restructure project as monorepo with workspace support #126
This file contains hidden or 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: main | |
on: | |
push: | |
branches: "*" | |
tags: "*" | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- run: deno task test --coverage --junit-path=junit.xml | |
env: | |
RUST_BACKTRACE: ${{ runner.debug }} | |
- uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
check_name: "Test Results" | |
files: junit.xml | |
continue-on-error: true | |
- if: '!cancelled()' | |
uses: codecov/test-results-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- run: deno coverage --lcov > coverage.lcov | |
- uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.lcov | |
- run: pnpm install | |
- run: pnpm run -r test | |
- run: deno task check | |
publish: | |
if: github.event_name == 'push' | |
needs: [test] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- if: github.ref_type == 'branch' | |
run: | | |
set -euo pipefail | |
jq \ | |
--arg build "$GITHUB_RUN_NUMBER" \ | |
--arg commit "${GITHUB_SHA::8}" \ | |
'.version = .version + "-dev." + $build + "+" + $commit' \ | |
packages/botkit/deno.json > deno.json.tmp | |
mv deno.json.tmp packages/botkit/deno.json | |
jq \ | |
--arg build "$GITHUB_RUN_NUMBER" \ | |
--arg commit "${GITHUB_SHA::8}" \ | |
'.version = .version + "-dev." + $build + "+" + $commit' \ | |
packages/botkit/package.json > package.json.tmp | |
mv package.json.tmp packages/botkit/package.json | |
- if: github.ref_type == 'tag' | |
run: | | |
set -euo pipefail | |
[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]] | |
[[ "$(jq -r .version package.json)" = "$GITHUB_REF_NAME" ]] | |
- run: | | |
set -euo pipefail | |
pnpm config set //registry.npmjs.org/:_authToken "$NPM_AUTH_TOKEN" | |
pnpm install | |
if [[ "$GITHUB_REF_TYPE" = tag ]]; then | |
pnpm publish --access public --no-git-checks | |
else | |
pnpm publish --access public --no-git-checks --tag dev | |
fi | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
NPM_CONFIG_PROVENANCE: "true" | |
- run: deno publish --allow-dirty | |
- if: github.ref_type == 'tag' | |
id: extract-changelog | |
uses: dahlia/submark@ed8f47b4d51fda07e12b6e991641a8bd5ec62f8e | |
with: | |
input-file: CHANGES.md | |
heading-level: 2 | |
heading-title-text: version ${{ github.ref_name }} | |
ignore-case: true | |
omit-heading: true | |
- if: github.ref_type == 'tag' | |
run: 'cat "$CHANGES_FILE"' | |
env: | |
CHANGES_FILE: ${{ steps.extract-changelog.outputs.output-file }} | |
- if: github.ref_type == 'tag' | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: ${{ steps.extract-changelog.outputs.output-file }} | |
name: BotKit ${{ github.ref_name }} | |
generate_release_notes: false | |
files: fedify-botkit-*.tgz | |
publish-docs: | |
if: github.event_name == 'push' | |
needs: [publish] | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deploy.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- run: pnpm install | |
working-directory: docs | |
- run: pnpm build | |
env: | |
PLAUSIBLE_DOMAIN: ${{ vars.PLAUSIBLE_DOMAIN }} | |
SITEMAP_HOSTNAME: https://${{ vars.PLAUSIBLE_DOMAIN }} | |
working-directory: docs | |
- id: upload | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/.vitepress/dist | |
- id: deploy | |
uses: actions/deploy-pages@v4 | |
# cSpell: ignore denoland submark softprops |