Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Security Audit
on:
schedule:
- cron: '0 8 * * 1'
workflow_dispatch:
push:
branches: [main]
paths:
Expand All @@ -15,4 +16,6 @@ jobs:
continue-on-error: false
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
# v2 bundles a current cargo-deny; the old v1 (cargo-deny 0.14.21)
# fails to parse newer entries in the rustsec advisory database.
- uses: EmbarkStudios/cargo-deny-action@v2
23 changes: 22 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -75,9 +76,29 @@ jobs:
if: always()
run: rm -rf semver-checks

# `main` is protected by the `main-protect` ruleset (pushes must come
# through a pull request; only repository admins may bypass), so a direct
# `git push origin main` is declined. Instead: push the release commit to
# a `release/vX.Y.Z` branch, open a PR, and merge it through the normal
# protected flow. Tags are not protected and are pushed afterwards.
- name: Open release PR and merge
if: ${{ !inputs.skip_bump }}
run: |
VERSION="$(cargo pkgid -p funera-core | sed 's/.*#//')"
BRANCH="release/v${VERSION}"
git push origin "HEAD:${BRANCH}"
PR_URL="$(gh pr create --base main --head "${BRANCH}" \
--title "chore: release v${VERSION}" \
--body "Automated release prepared by the CD workflow (version bump to v${VERSION}).")"
gh pr merge --merge --delete-branch "${PR_URL}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push tag
if: ${{ !inputs.skip_bump }}
run: git push origin main --follow-tags
run: |
VERSION="$(cargo pkgid -p funera-core | sed 's/.*#//')"
git push origin "refs/tags/v${VERSION}"

- name: Publish funera_core
run: cargo publish -p funera-core --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand Down
Loading