Release #33
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/[email protected] | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Cache rust | |
uses: Swatinem/[email protected] | |
- 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 "[email protected]" | |
- 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/[email protected] | |
- 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/[email protected] | |
- name: Cache rust | |
uses: Swatinem/[email protected] | |
- 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/[email protected] | |
with: | |
path: ./tarpaulin | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/[email protected] | |
update-branches: | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Merge main -> develop | |
uses: devmasx/[email protected] | |
with: | |
from_branch: main | |
target_branch: develop | |
github_token: ${{ github.token }} | |
type: now | |
- uses: actions/[email protected] | |
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 "[email protected]" | |
- name: Update version | |
run: | | |
cargo release version patch --execute --no-confirm | |
git add Cargo.toml | |
git commit --message "Update version: patch" | |
git push |