CI: add action to create release tarball

This commit is contained in:
rofl0r 2022-05-19 20:02:45 +00:00
parent c904706a6b
commit 204c58d81f
1 changed files with 43 additions and 0 deletions

43
.github/workflows/release_tarball.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Generate Source Tarball
# Trigger whenever a release is created
on:
release:
types:
- created
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: archive
id: archive
run: |
THISDIR="$PWD"
cd desmume/src/frontend/posix
autoreconf -i
cd "$THISDIR"
VERSION=$(printf "%s\n" ${{ github.event.release.tag_name }} | sed 's/^v//')
PKGNAME="desmume-$VERSION"
mkdir -p /tmp/$PKGNAME
mv * /tmp/$PKGNAME
mv /tmp/$PKGNAME .
TARBALL=$PKGNAME.tar.xz
tar cJf $TARBALL $PKGNAME
echo "::set-output name=tarball::$TARBALL"
- name: upload tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.tarball }}
asset_name: ${{ steps.archive.outputs.tarball }}
asset_content_type: application/x-xz