Release #63
Workflow file for this run
This file contains hidden or 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
# π»ββοΈπ ume: Easy, self-hostable, and flexible image host made in Rust | |
# Copyright 2021-2025 Noel Towa <[email protected]> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: Release | |
on: | |
release: | |
types: | |
- published | |
permissions: | |
packages: write | |
contents: write | |
jobs: | |
binary: | |
name: "Build `ume` binary (${{matrix.runner}}: ${{matrix.target}})" | |
runs-on: ${{matrix.runner}} | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
# ume (Linux x86_64) | |
- runner: ubuntu-latest | |
rustflags: "-Ctarget-cpu=native -Clink-arg=-fuse-ld=mold" | |
target: x86_64-unknown-linux-gnu | |
cross: false | |
flags: "" | |
ext: '' | |
# ume (Linux ARM64) | |
- runner: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
rustflags: '' | |
cross: true | |
flags: "" | |
ext: '' | |
# ume (macOS x86_64 ~ Intel) | |
- runner: macos-13 | |
target: x86_64-apple-darwin | |
rustflags: "-Ctarget-cpu=native" | |
cross: false | |
flags: "" | |
ext: '' | |
# ume (macOS ARM64 ~ Apple Silicon) | |
- runner: macos-latest | |
target: aarch64-apple-darwin | |
rustflags: '-Ctarget-cpu=native' | |
cross: false | |
flags: "" | |
ext: '' | |
# ume (Windows x86_64) | |
- runner: windows-latest | |
target: x86_64-pc-windows-msvc | |
rustflags: "-Ctarget-cpu=native" | |
flags: "" | |
cross: false | |
ext: .exe | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: auguwu/git-tag-action@master | |
id: tag | |
- run: rm rust-toolchain.toml | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: clippy, rustfmt | |
target: ${{matrix.target}} | |
- uses: taiki-e/cache-cargo-install-action@v2 | |
if: matrix.cross | |
with: | |
tool: cross | |
- if: matrix.runner == 'ubuntu-latest' | |
uses: rui314/setup-mold@v1 | |
- uses: Swatinem/rust-cache@v2 | |
- if: matrix.runner == 'windows-latest' | |
id: vcpkg | |
run: | | |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append | |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
- if: matrix.runner == 'windows-latest' | |
uses: actions/cache@v4 | |
with: | |
key: vcpkg-cache | |
path: | | |
${{steps.vcpkg.outputs.VCPKG_ROOT}} | |
- if: matrix.runner == 'windows-latest' | |
run: vcpkg install openssl:x64-windows-static-md | |
# On Windows, we'll also need nasm for use with BoringSSL via aws-lc-sys. | |
- uses: ilammy/setup-nasm@v1 | |
if: matrix.runner == 'windows-latest' | |
- name: Build binary | |
run: ./scripts/release${{matrix.runner == 'windows-latest' && '.ps1' || '.sh'}} | |
env: | |
BUILDTARGET: ${{matrix.target}} | |
BUILDFLAGS: ${{matrix.flags}} | |
RUSTFLAGS: ${{matrix.rustflags}} | |
CARGO: "${{matrix.cross && 'cross' || 'cargo'}}" | |
- name: Upload ume artifacts | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ./.result/ume-* | |
- name: Upload binary to S3 (${{steps.tag.outputs.version}}) | |
uses: Noelware/[email protected] | |
with: | |
enforce-path-access-style: true | |
access-key-id: ${{secrets.S3_ACCESS_KEY}} | |
secret-key: ${{secrets.S3_SECRET_KEY}} | |
path-format: $(prefix)/ume/${{steps.tag.outputs.version}}/$(file) | |
directories: .result | |
endpoint: ${{secrets.S3_ENDPOINT}} | |
prefix: /noel/artifacts | |
region: us-east-1 | |
bucket: august | |
- name: Upload binary to S3 (latest) | |
uses: Noelware/[email protected] | |
with: | |
enforce-path-access-style: true | |
access-key-id: ${{secrets.S3_ACCESS_KEY}} | |
secret-key: ${{secrets.S3_SECRET_KEY}} | |
path-format: $(prefix)/ume/latest/$(file) | |
directories: .result | |
endpoint: ${{secrets.S3_ENDPOINT}} | |
prefix: /noel/artifacts | |
region: us-east-1 | |
bucket: august | |
nix-build: | |
name: Nix Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install `nix` binary | |
uses: cachix/install-nix-action@v30 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Setup Cachix | |
uses: cachix/cachix-action@v15 | |
with: | |
name: noel | |
authToken: ${{secrets.CACHIX_AUTH_TOKEN}} | |
- name: Build `ume` binary | |
run: nix build .#ume | |
docker: | |
name: Build Docker Image [${{matrix.dockerfile}}] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
dockerfile: | |
- debian | |
- alpine | |
include: | |
- dockerfile: debian | |
suffix: "" | |
updateDescription: true | |
- dockerfile: alpine | |
suffix: "-alpine" | |
updateDescription: false | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Get Git tag | |
uses: auguwu/git-tag-action@master | |
id: tag | |
- name: Get commit hash | |
id: commit-hash | |
run: echo "commit=$(git rev-parse --short=8 $GITHUB_SHA)" >> $GITHUB_OUTPUT | |
- name: Login into Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: auguwu | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login into GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{github.repository_owner}} | |
password: ${{secrets.GH_TOKEN}} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push! | |
uses: docker/build-push-action@v6 | |
with: | |
provenance: false | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha | |
context: . | |
file: ./distribution/docker/${{matrix.dockerfile}}.Dockerfile | |
push: true | |
sbom: true | |
tags: | | |
ghcr.io/auguwu/ume:${{steps.tag.outputs.major}}.${{steps.tag.outputs.minor}}${{matrix.suffix}}, | |
ghcr.io/auguwu/ume:${{steps.tag.outputs.major}}${{matrix.suffix}}, | |
ghcr.io/auguwu/ume:${{steps.tag.outputs.version}}${{matrix.suffix}}, | |
ghcr.io/auguwu/ume:${{matrix.dockerfile == 'alpine' && 'alpine' || 'latest' }} | |
auguwu/ume:${{steps.tag.outputs.major}}.${{steps.tag.outputs.minor}}${{matrix.suffix}}, | |
auguwu/ume:${{steps.tag.outputs.major}}${{matrix.suffix}}, | |
auguwu/ume:${{steps.tag.outputs.version}}${{matrix.suffix}}, | |
auguwu/ume:${{matrix.dockerfile == 'alpine' && 'alpine' || 'latest' }} | |
labels: | | |
org.opencontainers.image.title=ume | |
org.opencontainers.image.description="π»ββοΈπ Easy, self-hostable, and flexible image host made in Rust" | |
org.opencontainers.image.version=${{steps.tag.outputs.version}} | |
org.opencontainers.image.revision=${{steps.commit-hash.outputs.commit}} | |
org.opencontainers.image.licenses=Apache-2.0 | |
org.opencontainers.image.documentation=https://floofy.dev/oss/ume | |
org.opencontainers.image.source=https://github.com/auguwu/ume/tree/${{steps.commit-hash.outputs.commit}} | |
- name: Update Docker Hub description | |
uses: peter-evans/dockerhub-description@v4 | |
if: matrix.updateDescription | |
with: | |
username: auguwu | |
password: ${{secrets.DOCKER_PASSWORD}} | |
repository: auguwu/ume | |
readme-filepath: ./distribution/docker/README.md |