Skip to content

Commit

Permalink
ci: Update release-please url and Integrate publish job (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikuroXina authored Jul 10, 2024
1 parent 6201474 commit c119156
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 53 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/publish.yaml

This file was deleted.

78 changes: 70 additions & 8 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,83 @@
on:
workflow_dispatch:
inputs:
force:
description: Whether forcing to publish a release
required: true
type: boolean
release_version:
description: Version to publish (vX.Y.Z)
required: true
type: string
push:
branches:
- main

permissions:
contents: write
id-token: write
pull-requests: write

name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- id: token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.HELPER_BOT_APP_ID }}
private_key: ${{ secrets.HELPER_BOT_PRIVATE_KEY }}

- uses: google-github-actions/release-please-action@v4
- uses: googleapis/release-please-action@v4
id: release_please
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
token: ${{ steps.token.outputs.token }}
outputs:
release_created: ${{ steps.release_please.outputs.release_created }}
tag_name: ${{ steps.release_please.outputs.tag_name }}

publish:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created || github.event.inputs.force }}
env:
VERSION: ${{ needs.release-please.outputs.tag_name || inputs.release_version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Generate docs
run: deno task doc

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs

- name: Setup Node.js package
run: |
deno run -A ./scripts/build_npm.ts ${VERSION#v}
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: npm/
provenance: true

- name: Publish package
run: npx jsr publish

- name: Upload files
env:
GH_TOKEN: ${{ github.token }}
run: |
set -e
echo "Creating tarball"
tar cvzf raw.tar.gz --directory=npm/ .
echo "Creating zip"
pushd npm
zip -r "$GITHUB_WORKSPACE/raw.zip" ./*
popd
echo "Uploading release assets"
gh release upload ${{ env.VERSION }} raw.zip raw.tar.gz --clobber

0 comments on commit c119156

Please sign in to comment.