en/.forgejo/workflows/publish.yaml
jutty 3494ba71e6
Some checks failed
/ verify (push) Has been cancelled
Setup Windows builds
2026-06-20 01:24:35 -03:00

90 lines
2.9 KiB
YAML

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
upload:
description: 'Upload built assets to the git.jutty.dev package registry'
type: boolean
required: false
default: true
jobs:
publish:
runs-on: docker
timeout-minutes: 20
container:
image: rust:slim
steps:
- name: Install action dependencies
run: apt-get install --no-install-recommends --update -y nodejs curl git
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-tags: true
- name: Setup Rust toolchain
run: |
rustup component add llvm-tools
rustup component add --toolchain nightly rustfmt clippy
rustup target add x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl
rustup target add x86_64-pc-windows-msvc
- name: Setup additional tooling
run: .forgejo/workflows/setup-tools.sh
- name: Setup CI user
run: |
useradd -m ci && chown -R ci:ci .
git config --global --add safe.directory "$PWD"
- name: Run all assessments
run: just ci verify
- name: Build x64 Linux glibc release binary
run: just release-build-gnu
- name: Build x64 Linux musl release binary
run: just release-build-musl
- name: Build x64 Windows MSVC release binary
run: just release-build-msvc
- name: Calculate SHA-256 hashes
run: just shasum
- name: Publish x64 Linux musl binary to git.jutty.dev registry
if: ${{ inputs.upload }}
run: |
version=$(./target/x86_64-unknown-linux-musl/release/en --version)
api_root=https://git.jutty.dev/api
url=$api_root/packages/jutty/generic/en/$version/en-x64-linux-musl
curl -fsSL \
--user jutty:${{ secrets.GJD_REGISTRY_TOKEN }} \
--upload-file target/x86_64-unknown-linux-musl/release/en $url
- name: Publish x64 Linux glibc binary to git.jutty.dev registry
if: ${{ inputs.upload }}
run: |
version=$(./target/x86_64-unknown-linux-gnu/release/en --version)
api_root=https://git.jutty.dev/api
url=$api_root/packages/jutty/generic/en/$version/en-x64-linux-gnu
curl -fsSL \
--user jutty:${{ secrets.GJD_REGISTRY_TOKEN }} \
--upload-file target/x86_64-unknown-linux-gnu/release/en $url
- name: Publish x64 Windows MSVC binary to git.jutty.dev registry
if: ${{ inputs.upload }}
run: |
version=$(./target/x86_64-unknown-linux-musl/release/en --version)
api_root=https://git.jutty.dev/api
url=$api_root/packages/jutty/generic/en/$version/en-x64-windows-msvc
curl -fsSL \
--user jutty:${{ secrets.GJD_REGISTRY_TOKEN }} \
--upload-file target/x86_64-pc-windows-msvc/release/en.exe $url