Add support for shutdown hibernate mode #49
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
- push | |
- pull_request | |
jobs: | |
build-ubuntu: | |
name: Build on Ubuntu x86_64 with ${{ matrix.CC }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
CC: | |
- gcc | |
- clang | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v1 | |
- name: Install build dependencies | |
run: sudo apt-get install asciidoctor | |
- run: make build CC=${{ matrix.CC }} | |
- run: ./build/zzz -V | |
- run: make install DESTDIR=dest | |
build-alpine: | |
name: Build on Alpine ${{ matrix.ARCH }} with ${{ matrix.CC }} ${{ matrix.LDFLAGS }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ARCH: | |
- x86_64 | |
- aarch64 | |
- armv7 | |
- ppc64le | |
- riscv64 | |
CC: | |
- gcc | |
LDFLAGS: | |
- '' | |
- -static -s | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v1 | |
with: | |
fetch-depth: 0 # fetch all history | |
- name: Install latest Alpine Linux for ${{ matrix.ARCH }} | |
uses: jirutka/setup-alpine@v1 | |
with: | |
arch: ${{ matrix.ARCH }} | |
branch: ${{ matrix.ARCH == 'riscv64' && 'edge' || 'latest-stable' }} | |
packages: asciidoctor build-base | |
- name: Get version | |
run: | | |
GIT_TAG=$(git describe --tags --match 'v*' 2>/dev/null || echo ${GITHUB_REF##*/}) | |
echo "VERSION=${GIT_TAG#v}" >> $GITHUB_ENV | |
- name: Build zzz | |
run: | | |
make build CC=${{ matrix.CC }} LDFLAGS="${{ matrix.LDFLAGS }}" VERSION="${{ env.VERSION }}" | |
ls -lah build/ | |
file build/zzz | |
shell: alpine.sh {0} | |
- name: zzz -V | |
run: ./build/zzz -V | |
shell: alpine.sh {0} | |
- name: Create tarball | |
if: ${{ matrix.LDFLAGS != '' }} | |
run: | | |
TARBALL_NAME=zzz-${{ env.VERSION }}-${{ matrix.ARCH }}-unknown-linux | |
cp LICENSE build/ | |
mv build $TARBALL_NAME | |
tar -czf $TARBALL_NAME.tar.gz $TARBALL_NAME | |
- name: Upload tarball to artifacts | |
if: ${{ matrix.LDFLAGS != '' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: tarballs | |
path: '*.tar.gz' | |
publish: | |
name: Publish tarballs to Releases | |
if: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name != 'pull_request' }} | |
needs: | |
- build-alpine | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Download tarballs from artifacts | |
uses: actions/download-artifact@v2 | |
- name: Generate checksums.txt | |
run: shasum -a 256 *.tar.gz | tee checksums.txt | |
working-directory: tarballs | |
- name: Upload tarballs to Releases | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: tarballs/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |