Skip to content

Commit

Permalink
Release script & CI: name based on tag (WIP broken)
Browse files Browse the repository at this point in the history
  • Loading branch information
sullyj3 committed Jul 25, 2024
1 parent ddcf8f5 commit 9a7c8b5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: CI

on:
workflow_dispatch:
on: [workflow_dispatch, push, pull_request]

jobs:
build:
Expand All @@ -10,17 +9,19 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-tags: "true"
- name: Run Lean Action
uses: leanprover/lean-action@v1
with:
auto-config: "false"
use-mathlib-cache: "false"
build: "true"
- name: Create package
id: create-package
run: |
./create_release.sh
- name: Upload artifact
uses: actions/[email protected]
with:
name: sand
path: release.tar.zst
path: release/sand-*-x86_64-linux.tar.zst
33 changes: 23 additions & 10 deletions create_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,30 @@ if [ ! -f .lake/build/bin/sand ]; then
exit 1
fi

mkdir -p release
tag=$(git describe --tags --abbrev=0)
dir="sand-$tag"

cp -f .lake/build/bin/sand release/
cp -rf resources release/
cp -f scripts/install.sh release/
cp -f LICENSE release/
cp -f README.md release/
set -x

strip release/sand
mkdir -p "release/$dir"

tar --zstd -cvf release.tar.zst release 2>&1 > /dev/null
cp -f .lake/build/bin/sand release/$dir/
cp -rf resources release/$dir/
cp -f scripts/install.sh release/$dir/
cp -f LICENSE release/$dir/
cp -f README.md release/$dir/

echo 'release created at `release`'
echo 'release archive created at `release.tar.zst`'
pushd release/ > /dev/null

strip $dir/sand

archive="$dir-x86_64-linux.tar.zst"

tar --zstd -cvf $archive $dir 2>&1 > /dev/null

popd > /dev/null

set +x

echo "release created at release/$dir"
echo "release archive created at release/$archive"

0 comments on commit 9a7c8b5

Please sign in to comment.