| 1 |
name: Build Source Release |
| 2 |
|
| 3 |
# Trigger whenever a release is created |
| 4 |
on: |
| 5 |
release: |
| 6 |
types: |
| 7 |
- created |
| 8 |
|
| 9 |
jobs: |
| 10 |
build: |
| 11 |
name: build |
| 12 |
runs-on: ubuntu-latest |
| 13 |
steps: |
| 14 |
- uses: actions/checkout@v1 |
| 15 |
with: |
| 16 |
submodules: true |
| 17 |
|
| 18 |
- name: archive |
| 19 |
id: archive |
| 20 |
run: | |
| 21 |
VERSION=${{ github.event.release.tag_name }} |
| 22 |
PKGNAME="capstone-$VERSION" |
| 23 |
SHASUM=$PKGNAME.tar.xz.sha256 |
| 24 |
mkdir -p /tmp/$PKGNAME |
| 25 |
mv * /tmp/$PKGNAME |
| 26 |
mv /tmp/$PKGNAME . |
| 27 |
TARBALL=$PKGNAME.tar.xz |
| 28 |
tar cJf $TARBALL $PKGNAME |
| 29 |
sha256sum $TARBALL > $SHASUM |
| 30 |
echo "::set-output name=tarball::$TARBALL" |
| 31 |
echo "::set-output name=shasum::$SHASUM" |
| 32 |
- name: upload tarball |
| 33 |
uses: actions/upload-release-asset@v1 |
| 34 |
env: |
| 35 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 36 |
with: |
| 37 |
upload_url: ${{ github.event.release.upload_url }} |
| 38 |
asset_path: ./${{ steps.archive.outputs.tarball }} |
| 39 |
asset_name: ${{ steps.archive.outputs.tarball }} |
| 40 |
asset_content_type: application/gzip |
| 41 |
|
| 42 |
- name: upload shasum |
| 43 |
uses: actions/upload-release-asset@v1 |
| 44 |
env: |
| 45 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 46 |
with: |
| 47 |
upload_url: ${{ github.event.release.upload_url }} |
| 48 |
asset_path: ./${{ steps.archive.outputs.shasum }} |
| 49 |
asset_name: ${{ steps.archive.outputs.shasum }} |
| 50 |
asset_content_type: text/plain |