-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Etienne Marais <[email protected]>
- Loading branch information
Showing
1 changed file
with
114 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ name: Binaries | |
|
||
on: | ||
workflow_dispatch: | ||
# schedule: | ||
# - cron: '0 1 * * *' # Triggers the build at 1:00 UTC time | ||
schedule: | ||
- cron: '0 1 * * *' # Triggers the build at 1:00 UTC time | ||
|
||
jobs: | ||
binary: | ||
|
@@ -16,12 +16,12 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
include: | ||
# - os: macos-13 | ||
# name: x86_64-apple-darwin | ||
# installable: .#dune-experimental | ||
# - os: macos-14 | ||
# name: aarch64-apple-darwin | ||
# installable: .#dune-experimental | ||
- os: macos-13 | ||
name: x86_64-apple-darwin | ||
installable: .#dune-experimental | ||
- os: macos-14 | ||
name: aarch64-apple-darwin | ||
installable: .#dune-experimental | ||
- os: ubuntu-22.04 | ||
name: x86_64-unknown-linux-musl | ||
installable: .#dune-static-experimental | ||
|
@@ -69,40 +69,38 @@ jobs: | |
path: ~/build/* | ||
name: ${{ matrix.name }} | ||
|
||
check-artifacts: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macos-13 | ||
name: x86_64-apple-darwin | ||
- os: macos-14 | ||
name: aarch64-apple-darwin | ||
- os: ubuntu-22.04 | ||
name: x86_64-unknown-linux-musl | ||
|
||
runs-on: ${{ matrix.os }} | ||
needs: binary | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/download-artifact@v4 | ||
|
||
- name: Get dune accessible | ||
run: | | ||
mv ./${{ matrix.name }}/dune ./dune | ||
chmod u+x ./dune | ||
# check-artifacts: | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# include: | ||
# - os: macos-13 | ||
# name: x86_64-apple-darwin | ||
# - os: macos-14 | ||
# name: aarch64-apple-darwin | ||
# - os: ubuntu-22.04 | ||
# name: x86_64-unknown-linux-musl | ||
# | ||
# runs-on: ${{ matrix.os }} | ||
# needs: binary | ||
# steps: | ||
# | ||
# - name: Checkout | ||
# uses: actions/checkout@v4 | ||
# | ||
# - uses: actions/download-artifact@v4 | ||
# | ||
# - name: Get dune accessible | ||
# run: | | ||
# mv ./${{ matrix.name }}/dune ./dune | ||
# chmod u+x ./dune | ||
# | ||
# - name: Check dune is working | ||
# run: | | ||
# export PATH="$PWD:$PATH" | ||
# cd test | ||
# dune pkg lock | ||
# dune build | ||
- name: Check dune is working | ||
run: | | ||
export PATH="$PWD:$PATH" | ||
cd test | ||
dune pkg lock | ||
dune build | ||
build_with_dune: | ||
needs: binary | ||
|
@@ -135,79 +133,79 @@ jobs: | |
|
||
|
||
|
||
# deploy-s3: | ||
# runs-on: ubuntu-latest | ||
# needs: [binary, check-artifacts] | ||
# permissions: | ||
# contents: write | ||
# 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: /home/runner/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 sync --commit "${{ needs.binary.outputs.git-commit }}" | ||
# | ||
# | ||
# - 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) || echo "No new data" # Prevent from committing empty stuff | ||
|
||
# notify: | ||
# runs-on: ubuntu-latest | ||
# needs: [ binary, check-artifacts, deploy-s3 ] | ||
# if: ${{ !cancelled() && (needs.binary.result == 'failure' || needs.check-artifacts.result == 'failure' || needs.deploy-s3.result == 'failure' ) }} | ||
# steps: | ||
# - name: Post an error message to Slack | ||
# id: slack | ||
# uses: slackapi/[email protected] | ||
# with: | ||
# channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
# slack-message: | | ||
# :red_circle: I'm sorry to bother you, but it seems your build is failing: | ||
# ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
# env: | ||
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
# | ||
deploy-s3: | ||
runs-on: ubuntu-latest | ||
needs: [binary, check-artifacts] | ||
permissions: | ||
contents: write | ||
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: /home/runner/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 sync --commit "${{ needs.binary.outputs.git-commit }}" | ||
|
||
|
||
- 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) || echo "No new data" # Prevent from committing empty stuff | ||
notify: | ||
runs-on: ubuntu-latest | ||
needs: [ binary, check-artifacts, deploy-s3 ] | ||
if: ${{ !cancelled() && (needs.binary.result == 'failure' || needs.check-artifacts.result == 'failure' || needs.deploy-s3.result == 'failure' ) }} | ||
steps: | ||
- name: Post an error message to Slack | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
slack-message: | | ||
:red_circle: I'm sorry to bother you, but it seems your build is failing: | ||
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|