Skip to content

release

release #8

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
draft:
type: boolean
concurrency: ${{ github.workflow }}
jobs:
tagver:
outputs:
tagver: ${{ steps.tagver.outputs.tagver }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: tagver
run: |
tagver=$(grep -Po 'TAGVER=\S+' script | head -n1 | cut -d'=' -f2)
echo "tagver=$tagver" >> "$GITHUB_OUTPUT"
create-release:
needs: tagver
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: jart/cosmopolitan
path: cosmopolitan
- working-directory: cosmopolitan
run: |
sudo wget -O /usr/bin/ape https://cosmo.zip/pub/cosmos/bin/ape-$(uname -m).elf
sudo chmod +x /usr/bin/ape
sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
sudo sh -c "echo ':APE-jart:M::jartsr::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
./tool/cosmocc/package.sh
echo "$PWD/cosmocc/bin" >> "$GITHUB_PATH"
- env:
TAGVER: ${{ needs.tagver.outputs.tagver }}
run: |
wget "https://ziglang.org/download/$TAGVER/zig-windows-x86_64-$TAGVER.zip"
wget "https://ziglang.org/download/$TAGVER/zig-windows-aarch64-$TAGVER.zip"
wget "https://ziglang.org/download/$TAGVER/zig-macos-aarch64-$TAGVER.tar.xz"
wget "https://ziglang.org/download/$TAGVER/zig-macos-x86_64-$TAGVER.tar.xz"
wget "https://ziglang.org/download/$TAGVER/zig-linux-x86_64-$TAGVER.tar.xz"
wget "https://ziglang.org/download/$TAGVER/zig-linux-aarch64-$TAGVER.tar.xz"
wget "https://ziglang.org/download/$TAGVER/zig-freebsd-x86_64-$TAGVER.tar.xz"
unzip -q "zig-windows-x86_64-$TAGVER.zip"
unzip -q "zig-windows-aarch64-$TAGVER.zip"
tar xf "zig-macos-aarch64-$TAGVER.tar.xz"
tar xf "zig-macos-x86_64-$TAGVER.tar.xz"
tar xf "zig-linux-x86_64-$TAGVER.tar.xz"
tar xf "zig-linux-aarch64-$TAGVER.tar.xz"
tar xf "zig-freebsd-x86_64-$TAGVER.tar.xz"
rm "zig-windows-x86_64-$TAGVER.zip"
rm "zig-windows-aarch64-$TAGVER.zip"
rm "zig-macos-aarch64-$TAGVER.tar.xz"
rm "zig-macos-x86_64-$TAGVER.tar.xz"
rm "zig-linux-x86_64-$TAGVER.tar.xz"
rm "zig-linux-aarch64-$TAGVER.tar.xz"
rm "zig-freebsd-x86_64-$TAGVER.tar.xz"
- env:
TAGVER: ${{ needs.tagver.outputs.tagver }}
run: ./build-zig-ape
- env:
TAGVER: ${{ needs.tagver.outputs.tagver }}
run: 7z a zig-ape-$TAGVER.zip zig-ape-$TAGVER/
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAGVER: ${{ needs.tagver.outputs.tagver }}
run: |
gh release create "$TAGVER" \
${{ (inputs.draft && '--draft') || '' }} \
--title "$TAGVER" \
--notes "https://ziglang.org/download/#release-$TAGVER" \
"zig-ape-$TAGVER.zip"