Skip to content

add missing package #15

add missing package

add missing package #15

Workflow file for this run

name: Release
on:
push:
branches: [main]
permissions:
contents: write
packages: write
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang tools
run: sudo apt-get update && sudo apt-get install -y clang-format clang-tidy
- name: Lint
run: make lint
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Cache cosmocc
uses: actions/cache@v4
with:
path: .cosmocc
key: cosmocc-3.9.2
- name: Build
run: make
- name: Test
run: make test
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: king-ape
path: king
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: king-ape
path: artifacts
- name: Generate checksums
run: |
cd artifacts
sha256sum king > checksums-sha256.txt
- name: Compute tag
id: tag
run: |
COMMIT_DATE=$(git log -1 --format=%cd --date=format:%Y.%m.%d)
SHORT_SHA=$(git rev-parse --short=7 HEAD)
echo "tag=v${COMMIT_DATE}-${SHORT_SHA}" >> "$GITHUB_OUTPUT"
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
COMMIT_MSG=$(git log -1 --format=%s)
IMAGE_NAME="ghcr.io/${GITHUB_REPOSITORY,,}"
gh release create "${{ steps.tag.outputs.tag }}" \
--title "${{ steps.tag.outputs.tag }}" \
--notes "**${COMMIT_MSG}**
Built from commit \`$(git rev-parse --short=7 HEAD)\` on \`main\`.
| File | Description |
|------|-------------|
| \`king\` | Actually Portable Executable — runs on Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD |
| Docker | \`${IMAGE_NAME}:${{ steps.tag.outputs.tag }}\` |" \
artifacts/king artifacts/checksums-sha256.txt
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Compute tag and image name
id: meta
run: |
COMMIT_DATE=$(git log -1 --format=%cd --date=format:%Y.%m.%d)
SHORT_SHA=$(git rev-parse --short=7 HEAD)
echo "tag=v${COMMIT_DATE}-${SHORT_SHA}" >> "$GITHUB_OUTPUT"
echo "image=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ steps.meta.outputs.image }}:latest
${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.tag }}