-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from mtzguido/main
Restoring mac builds, packaging, devcontainer
- Loading branch information
Showing
7 changed files
with
179 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: Pulse nightly build | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/checkout@master | ||
with: | ||
path: FStar | ||
repository: FStarLang/FStar | ||
|
||
- uses: ocaml/setup-ocaml@v3 | ||
with: | ||
ocaml-compiler: 4.14.2 | ||
|
||
- name: Prepare | ||
run: | | ||
./FStar/.scripts/get_fstar_z3.sh $HOME/bin | ||
echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV | ||
opam install --deps-only ./FStar/fstar.opam | ||
- run: eval $(opam env) && .scripts/mk_package.sh | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: pulse-*.tar.gz | ||
name: package-linux | ||
|
||
mac: | ||
runs-on: macos-14 | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/checkout@master | ||
with: | ||
path: FStar | ||
repository: FStarLang/FStar | ||
|
||
- uses: ocaml/setup-ocaml@v3 | ||
with: | ||
ocaml-compiler: 4.14.2 | ||
|
||
- name: Prepare | ||
run: | | ||
brew install opam bash gnu-getopt coreutils gnu-sed make | ||
./FStar/.scripts/get_fstar_z3.sh $HOME/bin | ||
echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV | ||
opam install --deps-only ./FStar/fstar.opam | ||
- run: eval $(opam env) && .scripts/mk_package.sh | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: pulse-*.tar.gz | ||
name: package-mac | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- linux | ||
- mac | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 0 # full clone, so we can push objects | ||
|
||
- name: Set up git | ||
run: | | ||
git config --global user.name "Dzomo, the Everest Yak" | ||
git config --global user.email "[email protected]" | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
merge-multiple: true | ||
# ^ Download all artifacts into the same dir. | ||
# Each of them is a single file, so no clashes happen. | ||
|
||
- name: Publish artifacts in nightly tag | ||
run: | | ||
git config --unset-all http.https://github.com/.extraheader | ||
# ^ https://stackoverflow.com/questions/64374179/how-to-push-to-another-repository-in-github-actions | ||
# We push nightly builds to a different repo (same org) | ||
REPO="${{github.repository}}-nightly" | ||
TAG=nightly-$(date -I) | ||
# Create tag | ||
git tag $TAG ${{github.sha}} | ||
# Add new remote and push tag | ||
git remote add nightly-repo https://${{secrets.DZOMO_GITHUB_TOKEN}}@github.com/$REPO | ||
git push nightly-repo $TAG | ||
# Create release | ||
gh release create -R "$REPO" \ | ||
--generate-notes \ | ||
--target ${{ github.sha }} \ | ||
$TAG artifacts/* | ||
env: | ||
GH_TOKEN: ${{ secrets.DZOMO_GITHUB_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,8 @@ BUILDLOG | |
out | ||
_output | ||
_cache | ||
|
||
# For package building | ||
FStar | ||
_pak | ||
pulse.tar.gz |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
# This scripts builds a "standalone" package with F* and Pulse. It | ||
# does not include karamel as there is no way to install it and use it | ||
# without setting a KRML_HOME, which I would like to avoid. This will be | ||
# fixed soon. | ||
|
||
set -eux | ||
|
||
if [ "$(uname -s)" = "Darwin" ]; then | ||
MAKE="gmake -ksj$(nproc)" | ||
else | ||
MAKE="make -ksj$(nproc)" | ||
fi | ||
|
||
if ! [ -d FStar ]; then | ||
git clone https://github.com/FStarLang/FStar --depth 1 | ||
fi | ||
|
||
$MAKE -C FStar ADMIT=1 | ||
export FSTAR_EXE=$(pwd)/FStar/bin/fstar.exe | ||
|
||
$MAKE ADMIT=1 | ||
|
||
rm -rf _pak | ||
mkdir -p _pak/pulse | ||
$MAKE -C FStar install PREFIX=$(pwd)/_pak/pulse | ||
|
||
$MAKE install PREFIX=$(pwd)/_pak/pulse | ||
|
||
cat >_pak/pulse/bin/pulse << EOF | ||
#!/bin/bash | ||
# Pulse is really just F* + an include path. The pulse plugin | ||
# is loaded automatically by F* when needed (e.g. when processing | ||
# a #lang-pulse declaration). | ||
D=\$(dirname "\$0") | ||
exec \$D/fstar.exe --include "\$D/../lib/pulse" "\$@" | ||
EOF | ||
|
||
chmod +x _pak/pulse/bin/pulse | ||
|
||
KERNEL=$(uname -s) | ||
ARCH=$(uname -m) | ||
PAK=pulse-$KERNEL-$ARCH.tar.gz | ||
|
||
tar czf $PAK -C _pak . | ||
|
||
echo Done | ||
ls -l $PAK |
This file contains 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