Release #34
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: Release | |
on: | |
workflow_dispatch: | |
jobs: | |
validate: | |
uses: ./.github/workflows/validate.yml | |
release: | |
needs: validate | |
permissions: | |
contents: write | |
outputs: | |
tag: ${{ steps.tag.outputs.tag }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2.7.1 | |
- name: Install cargo-release | |
run: cargo install cargo-release | |
- name: Cargo login | |
run: cargo login ${{ secrets.CRATES_API_TOKEN }} | |
- name: Setup git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions@users.noreply.github.com" | |
- name: Release rust library | |
run: cargo release --execute --no-confirm --tag-prefix "" --unpublished | |
- name: Output tag | |
id: tag | |
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT | |
github-release: | |
needs: release | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Create Github release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ needs.release.outputs.tag }} | |
publish-coverage: | |
needs: release | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
id-token: write | |
pages: write | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2.7.1 | |
- name: Install cargo-tarpaulin | |
run: cargo install cargo-tarpaulin | |
- name: Generate coverage report | |
run: | | |
cargo tarpaulin --out html -- --test-threads=1 | |
mkdir tarpaulin | |
mv ./tarpaulin-report.html ./tarpaulin/index.html | |
- name: Upload GitHub Pages artifact | |
uses: actions/upload-pages-artifact@v2.0.0 | |
with: | |
path: ./tarpaulin | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v3.0.1 | |
update-branches: | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Merge main -> develop | |
uses: devmasx/merge-branch@v1.4.0 | |
with: | |
from_branch: main | |
target_branch: develop | |
github_token: ${{ github.token }} | |
type: now | |
- uses: actions/checkout@v4.1.1 | |
with: | |
ref: develop | |
- name: Install cargo-release | |
run: cargo install cargo-release | |
- name: Setup git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions@users.noreply.github.com" | |
- name: Update version | |
run: | | |
cargo release version patch --execute --no-confirm | |
git add Cargo.toml | |
git commit --message "Update version: patch" | |
git push |