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
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ updates:
directory: "/"
schedule:
interval: "monthly"
cooldown:
default-days: 7
groups:
bump:
applies-to: "version-updates"
security:
applies-to: "security-updates"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
cooldown:
default-days: 7
19 changes: 19 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install toolchain
run: |
rustup toolchain install stable --profile minimal
rustup default stable
- name: Publish
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

51 changes: 41 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,50 @@
name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
type: string
required: true


env:
VERSION: "${{ inputs.version }}"

jobs:
publish:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- name: Install toolchain
- name: checkout
uses: actions/checkout@v5
with:
persist-credentials: true
fetch-depth: 0
- name: Git setup
run: |
rustup toolchain install stable --profile minimal
rustup default stable
- name: Publish
run: cargo publish
git config user.name "github-actions[bot]"
git config user.email " 41898282+github-actions[bot]@users.noreply.github.com"
- name: Update changelog
uses: orhun/git-cliff-action@d77b37db2e3f7398432d34b72a12aa3e2ba87e51 # v4.6.0
with:
args: "--unreleased"
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
OUTPUT: release.md
GIT_CLIFF_PREPEND: CHANGELOG.md
GIT_CLIFF_TAG: "v${{ inputs.version }}"
GITHUB_REPO: ${{ github.repository }}
- name: Update Cargo.toml
run: |
awk -i inplace -f update-version.awk Cargo.toml
- name: Commit and push changes
run: |
set +e
git add CHANGELOG.md Cargo.toml
git commit -m "Update version to ${VERSION}"
git push "https://github.com/${GITHUB_REPOSITORY}.git" main
- name: Create release
run: |
gh release create --notes-file release.md "v${VERSION}"


2 changes: 0 additions & 2 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ Steps to create a new release:
2. Run `gi-cliff -p CHANGELOG.md -u -t <new-tag>` to update the changelog
3. Merge changes
4. Publish a new release for the target tag.

TODO: Create github action to do all of this.
6 changes: 6 additions & 0 deletions tools/update-version.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$0 == "[package]" { inpkg = 1; }
inpkg && /^version +=/ {
sub(/"[^"]*"/, "\"" ENVIRON["VERSION"] "\"")
inpkg = 0
}
{ print }