Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
build: Bump bagop and hydrun conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
pojntfx committed Sep 12, 2023
1 parent 2156870 commit a680872
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/hydrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
schedule:
- cron: "0 0 * * 0"

permissions:
contents: write

jobs:
build-linux:
runs-on: ubuntu-latest
Expand All @@ -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:
Expand Down Expand Up @@ -57,6 +54,7 @@ jobs:
with:
name: ${{ matrix.target.id }}
path: ${{ matrix.target.dst }}

publish-linux:
runs-on: ubuntu-latest
needs: build-linux
Expand All @@ -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/*/*
Expand All @@ -84,4 +85,4 @@ jobs:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
/tmp/out/*/*
/tmp/out/*/*
24 changes: 7 additions & 17 deletions Hydrunfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -e

# Test
if [ "$1" = "test" ]; then
# Configure Git
git config --global --add safe.directory '*'

# Generate dependencies
make depend

Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ clean:

# Dependencies
depend:
exit 0
true
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit a680872

Please sign in to comment.