From 061d16d2b4c183bc9a36d72d6aaa847dbdd64205 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Wed, 24 Apr 2024 11:42:09 -0400 Subject: [PATCH] Add the action --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c1b2fde --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: "Publish crate to our Margo registry" +on: push + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Select Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Package crate + run: |- + set -eu + + cargo package + + mkdir /tmp/crates + mv ./target/package/*.crate /tmp/crates + + - name: Checkout GitHub Pages + uses: actions/checkout@v4 + with: + ref: gh-pages + + - name: Publish crate + uses: integer32llc/margo-actions@main + with: + crates: /tmp/crates/*.crate + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Commit and push to GitHub Pages + run: |- + set -eu + + git config user.email "basilisk@example.com" + git config user.name "Roko" + + git add . + git commit -m 'Publish' + git push origin gh-pages