Split the build. #878
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: Build sample material | |
on: | |
push: | |
pull_request: | |
jobs: | |
build-slides: | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install tools | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: mdbook@0.4.36,mdbook-mermaid@0.13.0 | |
- name: Add mdslides | |
run: | | |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ferrous-systems/mdslides/releases/download/v0.4.0/mdslides-installer.sh | sh | |
- name: Find slug name | |
run: | | |
slug=$(./describe.sh "${GITHUB_REF}") | |
echo "Building with slug '${slug}'" | |
echo "slug=${slug}" >> "${GITHUB_ENV}" | |
- name: Build book-and-slides | |
run: | | |
cd ./training-slides && ./build.sh | |
- name: Assemble Artifacts | |
run: | | |
echo "Making ./rust-training-${{ env.slug }}..." | |
mkdir -p ./rust-training-${{ env.slug }} | |
mv ./training-slides/slides ./rust-training-${{ env.slug }}/training-slides-presentation | |
mv ./training-slides/book ./rust-training-${{ env.slug }}/training-slides-book | |
cp -r ./example-code ./rust-training-${{ env.slug }} | |
echo "Compressing ./rust-training-${{ env.slug }}.zip..." | |
zip -r ./rust-training-${{ env.slug }}.zip ./rust-training-${{ env.slug }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{success()}} | |
with: | |
name: Artifacts | |
if-no-files-found: error | |
path: | | |
./rust-training-*/ | |
- name: Create and Upload Release | |
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/') | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ./rust-training-${{ env.slug }}.zip | |
build-examples-ferrocene: | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Critical Up | |
run: | | |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ferrocene/criticalup/releases/download/v1.1.0/criticalup-installer.sh | sh | |
- name: Find slug name | |
run: | | |
slug=$(./describe.sh "${GITHUB_REF}") | |
echo "Building with slug '${slug}'" | |
echo "slug=${slug}" >> "${GITHUB_ENV}" | |
- name: Build example code | |
env: | |
CRITICALUP_TOKEN: ${{ secrets.CRITICALUP_TOKEN }} | |
run: | | |
cd ./example-code && ./build_ferrocene.sh | |
- name: Assemble Artifacts | |
run: | | |
echo "Making ./rust-training-ferrocene-examples-${{ env.slug }}..." | |
mkdir -p ./rust-training-ferrocene-examples-${{ env.slug }} | |
cp -r ./example-code ./rust-training-ferrocene-examples-${{ env.slug }} | |
echo "Compressing ./rust-training-ferrocene-examples-${{ env.slug }}.zip..." | |
zip -r ./rust-training-ferrocene-examples-${{ env.slug }}.zip ./rust-training-ferrocene-examples-${{ env.slug }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{success()}} | |
with: | |
name: Artifacts | |
if-no-files-found: error | |
path: | | |
./rust-training-ferrocene-examples-*/ | |
build-examples: | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add Rust Targets | |
run: | | |
rustup target add thumbv7em-none-eabihf | |
rustup target add armv7r-none-eabihf | |
rustup target add aarch64-unknown-none | |
- name: Find slug name | |
run: | | |
slug=$(./describe.sh "${GITHUB_REF}") | |
echo "Building with slug '${slug}'" | |
echo "slug=${slug}" >> "${GITHUB_ENV}" | |
- name: Build example code | |
run: | | |
cd ./example-code && ./build.sh | |
- name: Assemble Artifacts | |
run: | | |
echo "Making ./rust-training-examples-${{ env.slug }}..." | |
mkdir -p ./rust-training-examples-${{ env.slug }} | |
cp -r ./example-code ./rust-training-examples-${{ env.slug }} | |
echo "Compressing ./rust-training-examples-${{ env.slug }}.zip..." | |
zip -r ./rust-training-examples-${{ env.slug }}.zip ./rust-training-examples-${{ env.slug }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{success()}} | |
with: | |
name: Artifacts | |
if-no-files-found: error | |
path: | | |
./rust-training-examples-*/ |