Skip to content

Nightly Release CLI #830

Nightly Release CLI

Nightly Release CLI #830

Workflow file for this run

name: Nightly Release CLI
on:
workflow_dispatch:
inputs:
distinct_id:
type: string
description: "Distinct ID"
required: false
jobs:
build:
name: Release - ${{ matrix.platform.release_for }}
strategy:
matrix:
platform:
- release_for: linux-aarch64
os: ubuntu-latest
goos: linux
goarch: arm64
bin_name: runtipi-cli
artifact_name: runtipi-cli-linux-aarch64
- release_for: linux-x86_64
os: ubuntu-latest
goos: linux
goarch: amd64
bin_name: runtipi-cli
artifact_name: runtipi-cli-linux-x86_64
runs-on: ${{ matrix.platform.os }}
steps:
- name: Echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.24.2"
- name: Install dependencies
run: go mod download
- name: Build binary
env:
GOOS: ${{ matrix.platform.goos }}
GOARCH: ${{ matrix.platform.goarch }}
CGO_ENABLED: 0
run: |
go build -v -o ${{ matrix.platform.bin_name }} \
-ldflags="-X main.version=nightly -X main.commit=$(git rev-parse --short HEAD) -X main.buildDate=$(date +%Y-%m-%dT%H:%M:%S%z) -s -w" \
./cmd/runtipi/main.go
- name: Compress with upx
run: |
sudo apt-get install -y upx
upx --best --lzma ${{ matrix.platform.bin_name }}
- name: Upload CLI
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.artifact_name }}
path: ${{ matrix.platform.bin_name }}
release:
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download all artifacts
uses: actions/download-artifact@v7
- name: Move artifacts
run: for dir in runtipi-cli-linux-*; do mv "$dir/runtipi-cli" "${dir}.cli" && rm -rf "$dir" && mv "${dir}.cli" "$dir"; done
- name: Compress artifacts
run: for file in runtipi-cli-linux-*; do tar -czvf "$file.tar.gz" "$file" && rm -rf "$file"; done
- uses: pyTooling/Actions/releaser@r0
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly
rm: true
files: runtipi-cli-*