-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Update release-please url and Integrate publish job (#236)
- Loading branch information
1 parent
6201474
commit c119156
Showing
2 changed files
with
70 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 |