-
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.
Self publish to GitHub Pages on release
- Loading branch information
1 parent
d1abf39
commit dc35335
Showing
1 changed file
with
48 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: "Publish crate to our Margo registry" | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
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 "[email protected]" | ||
git config user.name "Margo GitHub Action" | ||
git add . | ||
git commit -m 'Publish ${{ github.event.ref }}' | ||
git push origin gh-pages |