Skip to content

release 0.3.21 (#553) #113

release 0.3.21 (#553)

release 0.3.21 (#553) #113

on:
push:
tags:
- v*
pull_request:
paths:
- .github/workflows/update-spec-for-docs.yml
workflow_dispatch:
name: update spec for docs
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
update-spec:
name: update-spec
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ secrets.GH_ORG_APP_ID }}
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4
- name: Install latest stable/nightly
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
rustup default nightly
rustup default stable
rustup component add rustfmt
rustup component add rustfmt --toolchain nightly
rustup component add clippy
echo PATH="${HOME}/.cargo/bin:${PATH}" >> ${GITHUB_ENV}
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- name: make generate
shell: bash
run: |
make generate
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
# Ensure no files changed.
- name: Ensure no files changed
shell: bash
run: |
if [[ `git status --porcelain kittycad/README.md` ]]; then
echo "Files changed, exiting";
exit 1;
else
# No changes
echo "No files changed, proceeding";
fi
# Checkout the docs repo since we will want to update the files there.
- uses: actions/checkout@v4
with:
repository: 'kittycad/website'
path: 'website'
token: ${{ steps.app-token.outputs.token }}
- name: move json patch file to docs
shell: bash
run: |
rm website/kittycad.rs.patch.json || true
cp kittycad.rs.patch.json website/kittycad.rs.patch.json
- name: commit the changes in the website repo
shell: bash
run: |
export VERSION=$(cat VERSION.txt);
cd website
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -am "YOYO NEW RUST SPEC DOCS ${VERSION}!" || exit 0
git fetch origin
git rebase origin/main || exit 0
export NEW_BRANCH="update-spec-rust"
git checkout -b "$NEW_BRANCH"
git push -f origin "$NEW_BRANCH"
gh pr create --title "Update rust lang spec docs for ${VERSION}" \
--body "Updating the generated docs for rust" \
--head "$NEW_BRANCH" \
--reviewer jessfraz \
--reviewer irev-dev \
--reviewer franknoirot \
--base main || true
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}