Binaries #3
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
name: Binaries | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * *' # Triggers the build at 1:00 UTC time | |
jobs: | |
binary: | |
name: Create | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-13 | |
name: x86_64-apple-darwin | |
installable: .# | |
- os: macos-14 | |
name: aarch64-apple-darwin | |
installable: .# | |
- os: ubuntu-22.04 | |
name: x86_64-unknown-linux-musl | |
installable: .#dune-static | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: ocaml/dune | |
ref: main # At some point we might need to change it to point to a developer preview branch | |
fetch-depth: 0 # for git describe | |
- uses: cachix/install-nix-action@v22 | |
- run: echo "(version $(git describe --always --dirty --abbrev=7))" >> dune-project | |
- run: nix build ${{ matrix.installable }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: result/bin/dune | |
name: ${{ matrix.name }} | |
deploy-s3: | |
runs-on: ubuntu-latest | |
needs: binary | |
steps: | |
- name: Install rclone | |
run: | | |
sudo -v ; curl https://rclone.org/install.sh | sudo bash | |
- name: Prepare SSH env | |
shell: bash | |
run: | | |
mkdir -p ~/.ssh | |
echo "$SSH_PRIVATE_KEY" > ~/.ssh/tarides | |
echo "$SSH_PUBLIC_KEY" > ~/.ssh/tarides.pub | |
chmod 600 ~/.ssh/tarides | |
chmod 600 ~/.ssh/tarides.pub | |
ssh-keyscan -H "$DEPLOY_SERVER" >> ~/.ssh/known_hosts | |
env: | |
DEPLOY_SERVER: ${{ secrets.DEPLOY_SERVER }} | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup OCaml with cache | |
uses: ocaml/setup-ocaml@v3 | |
with: | |
ocaml-compiler: "5.2" | |
dune-cache: true | |
- name: Install Sandworm | |
run: cd sandworm && opam install -y . --deps-only && opam exec -- dune build | |
- uses: actions/download-artifact@v4 | |
with: | |
path: ~/artifacts | |
- name: Move artifacts to scope | |
run: mv "/home/runner/artifacts" "." | |
- name: Export Rclone configuration | |
run: echo "${{ secrets.RCLONE_CONF }}" >> rclone.conf | |
- name: Export executables and generate html | |
shell: bash | |
run: ./sandworm/_build/install/default/bin/sandworm | |
- name: Commit changes to branch | |
run: | | |
git config --global user.name 'Sandworm' | |
git config --global user.email '[email protected]' | |
git add index.html metadata.json | |
git commit -m "Nightly build $(date +'%Y-%m-%d')" | |
git push | |