84 lines
2.8 KiB
YAML
84 lines
2.8 KiB
YAML
name: Release Daemon
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
type: string
|
|
required: true
|
|
ref:
|
|
type: string
|
|
repository:
|
|
type: string
|
|
release-id:
|
|
type: string
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
type: string
|
|
required: true
|
|
ref:
|
|
type: string
|
|
repository:
|
|
type: string
|
|
release-id:
|
|
type: string
|
|
|
|
jobs:
|
|
goreleaser:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 1
|
|
ref: ${{ inputs.ref }}
|
|
repository: ${{ inputs.repository }}
|
|
|
|
- name: Add Local Git Tag For GoReleaser
|
|
run: git tag ${{ inputs.version }}
|
|
continue-on-error: true
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.24.11
|
|
|
|
- name: install udev-devel and pcap-devel
|
|
run: |
|
|
sudo dpkg --add-architecture arm64
|
|
# Only modify ubuntu official sources, not third-party sources
|
|
sudo sed -i 's/^deb http:\/\/azure.archive.ubuntu.com/deb [arch=amd64] http:\/\/azure.archive.ubuntu.com/' /etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || true
|
|
sudo sed -i 's/^Types: deb$/Types: deb\nArchitectures: amd64/' /etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || true
|
|
# Add arm64 sources
|
|
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/arm64.list
|
|
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/arm64.list
|
|
sudo apt update
|
|
sudo apt install -y libudev-dev libpcap-dev libudev-dev:arm64 libpcap-dev:arm64
|
|
|
|
- name: Install x86_64 cross-compiler
|
|
run: sudo apt-get update && sudo apt-get install -y build-essential
|
|
|
|
- name: Install ARM cross-compiler
|
|
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v3.1.0
|
|
env:
|
|
OLARES_RELEASE_ID: ${{ inputs.release-id }}
|
|
with:
|
|
distribution: goreleaser
|
|
workdir: './daemon'
|
|
version: v1.18.2
|
|
args: release --clean
|
|
|
|
- name: Upload to CDN
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
AWS_DEFAULT_REGION: 'us-east-1'
|
|
run: |
|
|
cd daemon/output && for file in $(ls *.tar.gz | grep -v no-release-id); do
|
|
aws s3 cp "$file" s3://terminus-os-install${{ secrets.REPO_PATH }}${file} --acl=public-read
|
|
done
|