Publish Cycle #58
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
# Run publish-cycle on main commits. | |
# | |
# Publish cycle comprises: | |
# - publish site, coverage reports and API documentation to https://nigeleke.github.io | |
# | |
name: Publish Cycle | |
on: | |
workflow_run: | |
workflows: ["Acceptance Cycle"] | |
branches: [main] | |
types: | |
- completed | |
jobs: | |
publish: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build Site | |
run: | | |
cargo doc --no-deps | |
cargo install cargo-tarpaulin | |
cargo tarpaulin --out html --output-dir target/coverage | |
mkdir docs0 | |
mkdir -p docs0/api | |
mkdir -p docs0/coverage | |
cp README.md docs0/ | |
cp -R target/doc/* docs0/api | |
cp -R target/coverage/tarpaulin-report.html docs0/coverage/index.html | |
cargo tarpaulin --out xml | |
git status | |
git diff | |
- name: Publish to Codecov | |
uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Build App | |
run: | | |
cargo install dioxus-cli --git https://github.com/DioxusLabs/dioxus.git | |
dx build --release | |
git status | |
git diff | |
- name: Publish App & Documentation | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Nigel Eke" | |
export VERSION=$(git describe --abbrev=0 --tags) | |
git status | |
git diff | |
git checkout gh-pages | |
git status | |
git diff | |
rm -rf docs | |
mv docs0 docs | |
mkdir docs/app/ | |
mv target/dx/scopa/release/web/public/* docs/app/ | |
git status | |
git diff | |
git add . | |
git commit -m "Release $VERSION" | |
git push |