mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-08 13:13:49 -05:00
92 lines
2.3 KiB
YAML
92 lines
2.3 KiB
YAML
name: Nightly Release
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
get-tag:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
tag: ${{ steps.tag.outputs.tag }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Get Docker image tag
|
|
id: tag
|
|
run: |
|
|
if [ "${GITHUB_REF_NAME}" == "main" ]; then
|
|
TAG="nightly"
|
|
else
|
|
TAG="${GITHUB_REF_NAME}-nightly"
|
|
fi
|
|
echo "Using tag $TAG"
|
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
build-binaries:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
|
|
- name: Install cross
|
|
run: RUSTFLAGS="" cargo install cross --git https://github.com/cross-rs/cross
|
|
|
|
- name: Set up Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
|
|
- name: Install deps
|
|
run: cd web && bun install
|
|
|
|
- name: Build amd64 binary
|
|
run: |
|
|
./build.sh cross build --target x86_64-unknown-linux-musl --release
|
|
mv target/x86_64-unknown-linux-musl/release/cup ./cup-linux-amd64
|
|
|
|
- name: Build arm64 binary
|
|
run: |
|
|
./build.sh cross build --target aarch64-unknown-linux-musl --release
|
|
mv target/aarch64-unknown-linux-musl/release/cup ./cup-linux-arm64
|
|
|
|
- name: Upload binaries
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: binaries
|
|
path: |
|
|
cup-linux-amd64
|
|
cup-linux-arm64
|
|
|
|
build-image:
|
|
needs:
|
|
- get-tag
|
|
- build-binaries
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- uses: ./.github/actions/build-image
|
|
with:
|
|
tags: |
|
|
${{ needs.get-tag.outputs.tag }}
|
|
gh-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
nightly-release:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- get-tag
|
|
- build-binaries
|
|
- build-image
|
|
steps:
|
|
- name: Download binaries
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: binaries
|
|
path: binaries
|
|
|
|
- uses: pyTooling/Actions/releaser@r0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
tag: ${{ needs.get-tag.outputs.tag }}
|
|
rm: true
|
|
files: binaries/*
|