Skip to content

Commit 68f1216

Browse files
committed
Add an example to the README.md.
1 parent ec680b3 commit 68f1216

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
11
# `savi-lang/action-build-release`
22

33
Build Savi application release binaries for multiple platforms from a single CI runner.
4+
5+
## Example
6+
7+
If you have a repository with a Savi application manifest named `my-app`, then you could use a workflow like this one to give a workflow that can be triggered manually at any time to tag a new release and upload release binaries as assets attached to the release:
8+
9+
```yaml
10+
name: release
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
version-tag:
16+
description: |
17+
The name of the version to release (e.g. `v1.2.3` or `v0.20220131.0`).
18+
required: true
19+
20+
jobs:
21+
all:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: savi-lang/action-install@v1.0.0
26+
27+
# Build the release binaries for all platforms and package in tarballs.
28+
- uses: savi-lang/action-build-release@v1
29+
id: my-app
30+
with:
31+
manifest-name: my-app
32+
tarball-name: my-app-${{ github.event.inputs.version-tag }}
33+
all-platforms: true
34+
macosx-accept-license: true
35+
windows-accept-license: true
36+
37+
# Tag the new release and upload the files from the tarball directory.
38+
- uses: softprops/action-gh-release@v1
39+
if: ${{ github.event.inputs.version-tag != '' }}
40+
with:
41+
tag_name: ${{ github.event.inputs.version-tag }}
42+
generate_release_notes: true
43+
token: ${{ secrets.BOT_GITHUB_TOKEN }} # (allows triggering workflows)
44+
fail_on_unmatched_files: true
45+
files: |
46+
${{ steps.my-app.outputs.tarball-directory }}/*
47+
```

0 commit comments

Comments
 (0)