Skip to content

Commit

Permalink
Update example.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jan 10, 2024
1 parent 24f204d commit 357122f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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') }}
Expand Down
9 changes: 8 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -231,6 +233,10 @@ async function extractChangelog() {
}

async function run() {
core.setOutput('built', 'false');
core.setOutput('changelog-entry', '');
core.setOutput('tag-version', '');

try {
detectVersion();

Expand All @@ -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);
}
Expand Down

0 comments on commit 357122f

Please sign in to comment.