Skip to content

Commit

Permalink
ci: release from GH Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
P403n1x87 committed Jul 2, 2021
1 parent 25d84f5 commit b07f042
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 1 deletion.
131 changes: 131 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
release-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: Release (Linux)
steps:
- uses: actions/checkout@v2
name: Checkout Austin

- name: Generate artifacts
run: |
sudo apt-get update
sudo apt-get -y install autoconf build-essential
autoreconf --install
./configure
make
export VERSION=$(cat src/austin.h | sed -r -n "s/.*VERSION[ ]+\"(.+)\"/\1/p");
pushd src
tar -Jcf austin-$VERSION-linux-amd64.tar.xz austin
popd
- name: Upload artifacts to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/austin-*
tag: ${{ github.ref }}
overwrite: true
file_glob: true

release-win:
runs-on: windows-latest
strategy:
fail-fast: false
name: Release (Windows)
steps:
- uses: actions/checkout@v2
name: Checkout Austin
with:
fetch-depth: 0

- name: Generate artifacts
shell: bash
run: |
echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH
export PATH="/c/Program Files (x86)/`ls /c/Program\ Files\ \(x86\) | grep \"[wW]i[xX] [tT]oolset\"`/bin:$PATH"
export VERSION=$(cat src/austin.h | sed -r -n "s/.*VERSION[ ]+\"(.+)\"/\1/p")
gcc -s -Wall -O3 -Os -o src/austin src/*.c -lpsapi -lntdll
git checkout "packaging/msi"
git checkout master
git checkout "packaging/msi" -- wix
export WIN_MSI="austin-$VERSION-win64.msi"
sed -i "s/%VERSION%/$VERSION/g" wix/Austin.wxs
pushd wix
candle Austin.wxs -out Austin.wixobj
light -ext WixUIExtension Austin.wixobj -out $WIN_MSI
popd
mv wix/$WIN_MSI src/$WIN_MSI;
test -f src/$WIN_MSI && echo ">> Windows MSI installer at src/$WIN_MSI" || echo ">> ERROR No Windows MSI installer generated."
pushd src
7z a -tzip austin-${VERSION}-win64.zip austin.exe
popd
- name: Upload to choco
shell: bash
run: |
export VERSION=$(cat src/austin.h | sed -r -n "s/.*VERSION[ ]+\"(.+)\"/\1/p")
export WIN_MSI="austin-$VERSION-win64.msi"
export WIN_MSI_HASH=$( sha256sum src/$WIN_MSI | head -c 64 )
git checkout "packaging/msi" -- choco
pushd choco
sed -i "s/%WIN_MSI_HASH%/$WIN_MSI_HASH/g" tools/chocolateyinstall.ps1
/bin/find . -type f -exec sed -i "s/%VERSION%/$VERSION/g" {} \; ;
choco apikey --key ${{ secrets.CHOCO_APIKEY }} --source https://push.chocolatey.org/
choco pack
choco push
popd
- name: Upload artifacts to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/austin-*
tag: ${{ github.ref }}
overwrite: true
file_glob: true

release-osx:
runs-on: macos-latest
strategy:
fail-fast: false
name: Release (macOS)
steps:
- uses: actions/checkout@v2
name: Checkout Austin

- name: Generate artifacts
run: |
export VERSION=$(cat src/austin.h | sed -n -E "s/.*VERSION[ ]+\"(.+)\"/\1/p")
echo "::set-output name=version::$VERSION"
gcc -Wall -O3 -Os -o src/austin src/*.c
pushd src
zip -r austin-${VERSION}-mac64.zip austin
popd
- name: Upload artifacts to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/austin-*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
53 changes: 53 additions & 0 deletions .github/workflows/release_arch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release (Linux archs)
on:
push:
tags:
- 'v*'
jobs:
release-linux-archs:
runs-on: ubuntu-latest
strategy:
matrix:
arch: ["armv7", "aarch64", "ppc64le"]
fail-fast: false
name: Build on ${{ matrix.arch }}
steps:
- uses: actions/checkout@v2
name: Checkout sources
- uses: uraimo/[email protected]
name: Run tests on ${{ matrix.arch }}
id: run-tests-on-arch
with:
arch: ${{ matrix.arch }}
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: --volume "${GITHUB_WORKSPACE}/artifacts:/artifacts"
setup: |
mkdir -p ./artifacts
run: |
apt-get update
apt-get -y install autoconf build-essential
autoreconf --install
./configure
make
export VERSION=$(cat src/austin.h | sed -r -n "s/.*VERSION[ ]+\"(.+)\"/\1/p");
pushd src
tar -Jcf austin-$VERSION-linux-${{ matrix.arch }}.tar.xz austin
mv austin-$VERSION-linux-${{ matrix.arch }}.tar.xz /artifacts
popd
- name: Show artifacts
run: |
ls -al ./artifacts
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/austin-*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ubuntu:20.04
COPY . /austin
RUN apt-get install -y autoconf && \
RUN apt-get update && \
apt-get install -y autoconf build-essential && \
cd /austin && \
autoreconf --install && \
./configure && \
Expand Down

0 comments on commit b07f042

Please sign in to comment.