Skip to content

fix

fix #38

Workflow file for this run

on:
push:
tags:
- v*
name: make-release
jobs:
makerelease:
name: make release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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: Cache cargo registry
uses: actions/[email protected]
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/[email protected]
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/[email protected]
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Run make generate
run: |
make generate
shell: bash
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";
git checkout .
fi
- name: Get if prerelease
shell: bash
id: extract_prerelease
run: |
if cat VERSION.txt | grep -q "rc"; then
echo "##[set-output name=prerelease;]$(echo true)"
else
echo "##[set-output name=prerelease;]$(echo false)"
fi
- name: Publish release
shell: bash
run: |
cargo publish -p kittycad --token ${{secrets.CARGO_TOKEN}}
- name: Create a Release
uses: softprops/action-gh-release@v1
with:
prerelease: ${{steps.extract_prerelease.outputs.prerelease}}