Create GH release #24
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: Build Go | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: [ "*.md" ] | |
pull_request: | |
branches: [ main ] | |
paths-ignore: [ "*.md" ] | |
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BUILDKIT_PROGRESS: "plain" # Full logs for CI build. | |
REGISTRY_URL: "docker.io" # docker.io or other target registry URL: where to push images to. | |
REGISTRY_SRC: "docker.io" # For BASE_NAMESPACE of images: where to pull base images from. | |
# DOCKER_REGISTRY_USERNAME and DOCKER_REGISTRY_PASSWORD is required for docker image push, they should be set in CI secrets. | |
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | |
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
# used to sync image to mirror registry | |
DOCKER_MIRROR_REGISTRY_USERNAME: ${{ secrets.DOCKER_MIRROR_REGISTRY_USERNAME }} | |
DOCKER_MIRROR_REGISTRY_PASSWORD: ${{ secrets.DOCKER_MIRROR_REGISTRY_PASSWORD }} | |
jobs: | |
build_docker_image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Docker | |
run: | | |
source ./tool.sh && build_image supervisord latest src/supervisord.Dockerfile && push_image | |
build_binary: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
- name: Build Binary | |
run: | | |
set -eux | |
pwd && ls -alh * | |
mkdir -pv build && mv src/etc src/webgui ./build/ | |
cd src/supervisord | |
go mod tidy && go test -v | |
go build -v -o ../../build/ | |
cd ../../ | |
ls -alh build | |
build_go_releaser: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
- name: Install cross-compiler for linux/arm64, UPX | |
env: | |
VER_UPX: "4.2.4" | |
run: | | |
sudo apt-get update -q && sudo apt-get -y install gcc-aarch64-linux-gnu ; | |
URL_UPX="https://github.com/upx/upx/releases/download/v${VER_UPX}/upx-${VER_UPX}-amd64_linux.tar.xz" ; | |
echo "Installing upx ${VER_UPX} from: ${URL_UPX}" ; | |
curl -o /tmp/TMP.txz -sL $URL_UPX && tar -C /opt/ -xJf /tmp/TMP.txz && rm /tmp/TMP.txz ; | |
ln -sf /opt/upx-${VER_UPX}-amd64_linux /opt/upx | |
export PATH="/opt/upx/:${PATH}" | |
upx --version | grep -E '^upx' | |
cd src/supervisord && go mod tidy -e | |
- uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean --snapshot | |
workdir: src/supervisord | |
env: | |
GITHUB_TOKEN: ${{ secrets.GA_TOKEN }} |