diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 665685f..ab23a09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,6 @@ name: CI on: - push: - branches: [main] pull_request: branches: [main] workflow_dispatch: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..daa1fb1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +on: + push: + branches: [main] + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + + deploy: + needs: release-please + if: needs.release-please.outputs.release_created == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - run: npm ci + + - run: npm run cf:build + + - run: npm run cf:deploy + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..b985ff6 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..5987c28 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "node", + "packages": { + ".": {} + } +} diff --git a/src/pages/index.astro b/src/pages/index.astro index f3f6b9f..699e0d2 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,5 +1,14 @@ --- +import { execSync } from 'child_process'; import Base from '../layouts/Base.astro'; +import { version } from '../../package.json'; + +let siteVersion: string; +try { + siteVersion = execSync('git describe --tags --abbrev=0', { encoding: 'utf8' }).trim(); +} catch { + siteVersion = `v${version}`; +} const libraries = [ { @@ -103,6 +112,7 @@ const libraries = [ > github.com/wavekat + {siteVersion} Apache 2.0