Skip to content

Readme

Readme #133

Workflow file for this run

name: Release
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- "main"
env:
PROJECT_NAME: http-server
JUST_VERSION: "1.36.0"
jobs:
test:
name: πŸ§ͺ Test
runs-on: ubuntu-24.04
steps:
- { uses: actions/checkout@v4, with: { submodules: true } }
- run: source ./.github/install-scripts/just/main.ps1
- run: source ./.github/install-scripts/rust/main.ps1
- run: just test
format:
name: πŸ“ Format
runs-on: ubuntu-24.04
steps:
- { uses: actions/checkout@v4, with: { submodules: true } }
- run: source ./.github/install-scripts/just/main.ps1
- run: source ./.github/install-scripts/rust/main.ps1
- run: just fmt
lint:
name: πŸ€“ Lint
runs-on: ubuntu-24.04
steps:
- { uses: actions/checkout@v4, with: { submodules: true } }
- run: source ./.github/install-scripts/just/main.ps1
- run: source ./.github/install-scripts/rust/main.ps1
- run: just lint
build:
strategy:
matrix:
config:
- name: πŸ₯ Linux AMD64
os: linux
arch: amd64
runner: ubuntu-24.04
run: rustup target add x86_64-unknown-linux-musl
- name: πŸ₯ Linux ARM64
os: linux
arch: arm64
runner: ubuntu-24.04-arm
run: rustup target add aarch64-unknown-linux-musl
- name: 🍎 MacOS AMD64
os: macos
arch: amd64
runner: macos-13
- name: 🍎 MacOS ARM64
os: macos
arch: arm64
runner: macos-15
- name: 🟦 Windows AMD64
os: windows
arch: amd64
runner: windows-latest
- name: 🟦 Windows ARM64
os: windows
arch: arm64
runner: windows-latest
run: rustup target add aarch64-pc-windows-msvc
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.runner }}
steps:
- { uses: actions/checkout@v4, with: { submodules: true } }
- run: . ./.github/install-scripts/just/main.ps1
- run: . ./.github/install-scripts/rust/main.ps1
- if: matrix.config.run
run: ${{ matrix.config.run }}
- env:
os: "${{ matrix.config.os }}"
arch: "${{ matrix.config.arch }}"
profile: "release"
run: just build
- uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}-${{ matrix.config.os }}-${{ matrix.config.arch }}
path: ${{ github.workspace }}/target/${{ matrix.config.os }}-${{ matrix.config.arch }}/**/*
if-no-files-found: error
retention-days: 1
publish-github-release:
name: "πŸ”„ Publish Github Release"
runs-on: ubuntu-24.04
needs:
- test
- format
- lint
- build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with: { path: artifacts }
- name: Publish` Github Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
TAG="$(date -u +"v%Y.%m.%d.%H%M").${GITHUB_SHA::4}"
echo "Tag: ${TAG}"
gh release create $TAG --draft --notes "Automatically built binaries"
gh release edit $TAG --title "πŸš€ Latest"
cd artifacts
for name in *; do
cd "${{ github.workspace }}/artifacts/${name}/release"
tar -czvf ./${name}.tar.gz ./*
gh release upload $TAG ${name}.tar.gz
done
gh release edit $TAG --draft=false