65 lines
1.8 KiB
YAML
65 lines
1.8 KiB
YAML
name: Build Source Release
|
|
|
|
# Trigger whenever a release is created
|
|
on:
|
|
release:
|
|
types:
|
|
- created
|
|
|
|
jobs:
|
|
build:
|
|
name: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Make setup.sh and check_capstone.sh are executable
|
|
run: |
|
|
chmod +x ./packages/deb/setup.sh
|
|
chmod +x ./packages/deb/check_capstone.sh
|
|
|
|
- name: Build Debian Package
|
|
working-directory: ./packages/deb
|
|
run: ./setup.sh ${{ github.event.release.tag_name }}
|
|
|
|
- name: Run sanity checks on the Debian package
|
|
working-directory: ./packages/deb
|
|
run: |
|
|
./check_capstone.sh ./libcapstone-dev_${{ github.event.release.tag_name }}_amd64.deb
|
|
|
|
- name: Upload debian package to release
|
|
uses: softprops/action-gh-release@v2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.event.release.tag_name }}
|
|
files: |
|
|
./packages/deb/*.deb
|
|
|
|
- name: Create archive
|
|
id: archive
|
|
run: |
|
|
VERSION=${{ github.event.release.tag_name }}
|
|
PKGNAME="capstone-$VERSION"
|
|
SHASUM=$PKGNAME.tar.xz.sha256
|
|
mkdir -p /tmp/$PKGNAME
|
|
mv * /tmp/$PKGNAME
|
|
mv /tmp/$PKGNAME .
|
|
TARBALL=$PKGNAME.tar.xz
|
|
tar cJf $TARBALL $PKGNAME
|
|
sha256sum $TARBALL > $SHASUM
|
|
echo "tarball=$TARBALL" >> $GITHUB_OUTPUT
|
|
echo "shasum=$SHASUM" >> $GITHUB_OUTPUT
|
|
|
|
- name: Upload tarball and shasum to release
|
|
uses: softprops/action-gh-release@v2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.event.release.tag_name }}
|
|
files: |
|
|
${{ steps.archive.outputs.tarball }}
|
|
${{ steps.archive.outputs.shasum }}
|