From a68087273ffee4d5858ea68113e099ad933bc3ad Mon Sep 17 00:00:00 2001 From: Felicitas Pojtinger Date: Wed, 13 Sep 2023 00:59:33 +0200 Subject: [PATCH] build: Bump bagop and hydrun conventions --- .github/workflows/hydrun.yaml | 25 +++++++++++++------------ Hydrunfile | 24 +++++++----------------- Makefile | 2 +- README.md | 3 +-- 4 files changed, 22 insertions(+), 32 deletions(-) diff --git a/.github/workflows/hydrun.yaml b/.github/workflows/hydrun.yaml index 6b2c2b3..d0b6b00 100644 --- a/.github/workflows/hydrun.yaml +++ b/.github/workflows/hydrun.yaml @@ -6,6 +6,9 @@ on: schedule: - cron: "0 0 * * 0" +permissions: + contents: write + jobs: build-linux: runs-on: ubuntu-latest @@ -14,21 +17,15 @@ jobs: target: - id: test src: . - os: golang:bullseye + os: golang:bookworm flags: "" cmd: GOFLAGS="-short" ./Hydrunfile test dst: out/* - - id: go + - id: go-invaentory src: . - os: golang:bullseye + os: golang:bookworm flags: "" - cmd: ./Hydrunfile go - dst: out/* - - id: gccgo - src: . - os: ghcr.io/pojntfx/bagccgop-base-sid - flags: -e '--privileged' - cmd: ./Hydrunfile gccgo + cmd: ./Hydrunfile go invaentory dst: out/* steps: @@ -57,6 +54,7 @@ jobs: with: name: ${{ matrix.target.id }} path: ${{ matrix.target.dst }} + publish-linux: runs-on: ubuntu-latest needs: build-linux @@ -68,12 +66,15 @@ jobs: uses: actions/download-artifact@v2 with: path: /tmp/out + - name: Extract branch name + id: extract_branch + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - name: Publish pre-release to GitHub releases if: ${{ github.ref == 'refs/heads/main' }} uses: marvinpinto/action-automatic-releases@latest with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: unstable + automatic_release_tag: release-${{ steps.extract_branch.outputs.branch }} prerelease: true files: | /tmp/out/*/* @@ -84,4 +85,4 @@ jobs: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false files: | - /tmp/out/*/* \ No newline at end of file + /tmp/out/*/* diff --git a/Hydrunfile b/Hydrunfile index 2af48b5..5ae9969 100755 --- a/Hydrunfile +++ b/Hydrunfile @@ -4,6 +4,9 @@ set -e # Test if [ "$1" = "test" ]; then + # Configure Git + git config --global --add safe.directory '*' + # Generate dependencies make depend @@ -19,6 +22,9 @@ if [ "$1" = "go" ]; then apt update apt install -y curl make + # Configure Git + git config --global --add safe.directory '*' + # Install bagop curl -L -o /tmp/bagop "https://github.com/pojntfx/bagop/releases/latest/download/bagop.linux-$(uname -m)" install /tmp/bagop /usr/local/bin @@ -27,23 +33,7 @@ if [ "$1" = "go" ]; then make depend # Build - CGO_ENABLED=0 bagop -j "$(nproc)" -b invaentory -x '(android/*|ios/*)' -p 'make build/invaentory DST=$DST' -d out - - exit 0 -fi - -# gccgo -if [ "$1" = "gccgo" ]; then - # Install native dependencies - apt update - apt install -y curl - - # Install bagccgop - curl -L -o /tmp/bagccgop "https://github.com/pojntfx/bagccgop/releases/latest/download/bagccgop.linux-$(uname -m)" - install /tmp/bagccgop /usr/local/bin - - # Build - GOFLAGS='-gccgoflags=-static' bagccgop -x '(linux/alpha|linux/mipsle|linux/386|linux/amd64|linux/arm|linux/arm64|linux/mips|linux/mips64|linux/mips64le|linux/mipsle|linux/ppc64|linux/ppc64le|linux/riscv64|linux/s390x|linux/sparc64)' -j1 -b invaentory -n -r 'make depend' -s 'build-essential,automake' -p 'make build/invaentory DST=$DST' -d out + CGO_ENABLED=0 bagop -j "$(nproc)" -b "$2" -x '(android/*|ios/*|plan9/*|aix/*|linux/loong64|freebsd/riscv64|wasip1/wasm)' -p "make build/$2 DST=\$DST" -d out exit 0 fi diff --git a/Makefile b/Makefile index 95490a3..2494637 100644 --- a/Makefile +++ b/Makefile @@ -45,4 +45,4 @@ clean: # Dependencies depend: - exit 0 \ No newline at end of file + true \ No newline at end of file diff --git a/README.md b/README.md index 1d43d63..49ac27e 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,6 @@ Usage of invaentory: ## Acknowledgements - This project would not have been possible were it not for [@digineo](https://github.com/digineo)'s [go-ping](https://github.com/digineo/go-ping) package; be sure to check it out too! -- All the rest of the authors who worked on the dependencies used! Thanks a lot! ## Contributing @@ -159,6 +158,6 @@ Have any questions or need help? Chat with us [on Matrix](https://matrix.to/#/#i ## License -invaentory (c) 2022 Felicitas Pojtinger and contributors +invaentory (c) 2023 Felicitas Pojtinger and contributors SPDX-License-Identifier: AGPL-3.0