Skip to content

Add search by tag via tag click #59

Add search by tag via tag click

Add search by tag via tag click #59

Workflow file for this run

name: release
on:
pull_request:
push:
tags:
- v*
jobs:
build:
name: build
strategy:
fail-fast: false
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
arch: [ amd64, arm64 ]
exclude:
- os: ubuntu-latest
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: Install wails
run: make wails && wails doctor
- name: Install amd64 deps
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'amd64'
run: |
sudo sed -i 's/htt[p|ps]:\/\/azure.archive.ubuntu.com\/ubuntu\//https:\/\/mirror.bytemark.co.uk\/ubuntu\//g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install --no-install-recommends -y libgtk-3-dev libwebkit2gtk-4.0-dev libc6-dev-i386
- name: Install arm64 deps
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
run: |
sudo sed -i 's/htt[p|ps]:\/\/azure.archive.ubuntu.com\/ubuntu\//https:\/\/mirror.bytemark.co.uk\/ubuntu\//g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install --no-install-recommends -y libgtk-3-dev libwebkit2gtk-4.0-dev libc6-dev-i386 gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6-dev-i386
- name: dist
run: mkdir -p dist
- name: prep compiler (windows)
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64'
run: |
choco install mingw
echo 'CC="x86_64-w64-mingw32-gcc"' >> $env:GITHUB_ENV
- name: prep compiler (linux)
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
run: |
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: set arch
if: matrix.os == 'ubuntu-latest'
run: |
echo "GOARCH=${{ matrix.arch }}" >> $GITHUB_ENV
echo "GOHOSTARCH=amd64" >> $GITHUB_ENV
- name: prep vars
if: matrix.os == 'windows-latest'
run: |
echo "W_OS=windows" >> $env:GITHUB_ENV
echo "W_ARCH=${{ matrix.arch }}" >> $env:GITHUB_ENV
echo "W_PLATFORM=windows/${{ matrix.arch }}" >> $env:GITHUB_ENV
echo "W_VERSION=$(git describe --always --tags)" >> $env:GITHUB_ENV
- name: prep vars
if: matrix.os != 'windows-latest'
run: |
OS=${{ matrix.os }}
[[ "$OS" = "macos-latest" ]] && OS=darwin
[[ "$OS" = "ubuntu-latest" ]] && OS=linux
echo W_OS=${OS} >> $GITHUB_ENV
echo W_ARCH=${{ matrix.arch }} >> $GITHUB_ENV
echo "W_PLATFORM=${OS}/${{ matrix.arch }}" >> $GITHUB_ENV
echo "W_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
- name: build
run: |
# create universal bindings
wails build -compiler=echo -noPackage
# create platform-specific build
wails build -skipbindings -platform="${{ env.W_PLATFORM }}" -ldflags="-X 'github.com/ghostsecurity/reaper/version.Version=${W_VERSION}' -X 'github.com/ghostsecurity/reaper/version.Date=$(date)' -s -w" | tee build.log
- name: grab filename
if: matrix.os != 'windows-latest'
run: echo $(grep '^Built ''' build.log | tail -n1 | sed "s/^Built '\(.*\)'.*$/RFILE=\1/g") >> $GITHUB_ENV
- name: grab filename
if: matrix.os == 'windows-latest'
run: echo $(grep '^Built ''' build.log | tail -n1 | sed "s/^Built '\(.*\)'.*$/RFILE=\1/g") >> $env:GITHUB_ENV
- name: move artifact
run: |
mkdir -p release
cp '${{ env.RFILE }}' release/$(basename '${{ env.RFILE }}' | sed s/reaper/reaper-${{ env.W_OS }}-${{ env.W_ARCH }}/g)
ls release/
- name: cache artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.W_OS }}-${{ matrix.arch }}-${{github.run_id}}
path: release
publish:
needs: build
name: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: mkdir -p release || true
- uses: actions/download-artifact@v3
with:
path: release/
- run: |
ls release/
find ./release -name 'reaper-*' -exec chmod +x {} \;
- name: create changelog
if: startsWith(github.ref, 'refs/tags/')
run: |
git log $(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1` || git rev-list --max-parents=0 HEAD)..HEAD --oneline --no-color 2>&1 | sed 's/^[^ ]* /- /' | grep -v '^- test:' | grep -v '^- docs:' | grep -v '^- build:' | tee changelog.md
- name: github release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: changelog.md
files: |
release/*/*