From 357122f0c7fd2a231fb6d9edfdc77b1bfb16a127 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 9 Jan 2024 17:28:05 -0800 Subject: [PATCH] Update example. --- CHANGELOG.md | 3 ++- README.md | 5 ++++- index.ts | 9 ++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1aa806..8cad253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # 0.2.0 -- Will attempt to extract a changelog. - Added `built`, `changelog-entry`, and `tag-version` outputs. +- Will attempt to extract a changelog. + - Refer to our readme for an updated GitHub workflow example. # 0.1.0 diff --git a/README.md b/README.md index 8667689..2daf813 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ for distribution. It achieves this by: - Optimizes all `.wasm` files with `wasm-opt` and `wasm-strip`. - Generates `.sha256` checksum files for all `.wasm` files. - Moves built files to a `builds` directory. +- Extract changelog information for a release. ## Installation @@ -36,12 +37,14 @@ jobs: with: cache: false targets: wasm32-wasi - - uses: moonrepo/build-proto-plugin@v0 + - id: build + uses: moonrepo/build-proto-plugin@v0 - if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} uses: ncipollo/release-action@v1 with: artifacts: builds/* artifactErrorsFailBuild: true + body: ${{ steps.build.outputs.changelog-entry }} prerelease: ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc') }} diff --git a/index.ts b/index.ts index 84baaf4..e989d08 100644 --- a/index.ts +++ b/index.ts @@ -199,6 +199,8 @@ async function buildPackages(builds: BuildInfo[]) { core.info(`\tChecksum file: ${outputFile}`); core.info(`\tChecksum: ${checksumHash}`); } + + core.setOutput('built', 'true'); } async function extractChangelog() { @@ -231,6 +233,10 @@ async function extractChangelog() { } async function run() { + core.setOutput('built', 'false'); + core.setOutput('changelog-entry', ''); + core.setOutput('tag-version', ''); + try { detectVersion(); @@ -239,8 +245,9 @@ async function run() { if (builds.length > 0) { await Promise.all([installWabt(), installBinaryen(), addRustupTarget()]); await buildPackages(builds); - await extractChangelog(); } + + await extractChangelog(); } catch (error: unknown) { core.setFailed(error as Error); }