-
Notifications
You must be signed in to change notification settings - Fork 803
Expand file tree
/
Copy pathaction.yml
More file actions
53 lines (50 loc) · 1.8 KB
/
action.yml
File metadata and controls
53 lines (50 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Upload release archive
description: Bundles an archive of artifacts and uploads to a GitHub release. The artifacts must already have been built into the folder "install".
inputs:
os:
description: The OS runner name being built, used in the archive name
required: true
upload_to_release:
description: Whether to upload the archives to the release
runs:
using: composite
steps:
- name: archive
id: archive
shell: bash
run: |
declare -A OSNAME=(
[ubuntu-20.04]="linux-x64",
[ubuntu-24.04-arm]="linux-arm64",
[macos-14]="macos-14",
[windows-latest]="windows-x64",
[wasi]="wasi",
)
VERSION=${{ github.event.release.tag_name || github.sha }}
PKGNAME="wabt-$VERSION-${OSNAME[${{ inputs.os }}]}"
TARBALL=$PKGNAME.tar.gz
SHASUM=$PKGNAME.tar.gz.sha256
mv install wabt-$VERSION
tar -czf $TARBALL wabt-$VERSION
scripts/sha256sum.py $TARBALL > $SHASUM
echo "tarball=$TARBALL" >> $GITHUB_OUTPUT
echo "shasum=$SHASUM" >> $GITHUB_OUTPUT
- name: upload tarball to CI
uses: actions/upload-artifact@v4
with:
name: ${{ steps.archive.outputs.tarball }}
path: ./${{ steps.archive.outputs.tarball }}
- name: upload tarball to release
uses: svenstaro/upload-release-action@v2
if: ${{ inputs.upload_to_release }}
with:
file: ./${{ steps.archive.outputs.tarball }}
asset_name: ${{ steps.archive.outputs.tarball }}
tag: ${{ github.ref }}
- name: upload shasum
uses: svenstaro/upload-release-action@v2
if: ${{ inputs.upload_to_release }}
with:
file: ./${{ steps.archive.outputs.shasum }}
asset_name: ${{ steps.archive.outputs.shasum }}
tag: ${{ github.ref }}