Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
  • Loading branch information
rissson committed Nov 5, 2024
1 parent 2adbd21 commit ceb66b5
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install poetry & deps
shell: bash
run: |
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,40 @@ jobs:
tool: just
- name: Test
run: poetry run just ci-test-${{ matrix.job }}
check:
if: always()
needs:
- lint
- build
- test
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
release:
needs:
- check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- crate: kadmin-sys
extra_args: "--no-verify"
- crate: kadmin
extra_args: ""
if: github.event_name == 'push' && startsWith(github.ref, format('refs/tags/{0}/version/', matrix.crate))
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@v2
with:
tool: just
- run: just ci-build-deps
- run: cargo publish --package ${{ matrix.crate }} ${{ matrix.extra_args }}
39 changes: 39 additions & 0 deletions .github/workflows/release-create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Create release

on:
pull_request:
types:
- closed
branches:
- main

jobs:
release-info:
if: github.event.pull_request.merged
outputs:
is-release: ${{ steps.meta.outputs.is-release }}
package: ${{ steps.meta.outputs.crates-name }}
version: ${{ steps.meta.outputs.version-actual }}
runs-on: ubuntu-latest
steps:
- id: meta
uses: cargo-bins/release-meta@v1
with:
event-data: ${{ toJSON(github.event) }}

release-create:
needs:
- info
if: needs.info.outputs.is-release == 'true'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v2
with:
name: "${{ needs.info.outputs.package }} ${{ needs.info.outputs.version }}"
tag_name: "${{ needs.info.outputs.package }}/version/${{ needs.info.outputs.version }}"
target_commitish: "${{ github.sha }}"
draft: true
make_latest: true
44 changes: 44 additions & 0 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Release

on:
workflow_dispatch:
inputs:
package:
description: Package to release
required: true
type: choice
options:
- kadmin-sys
- kadmin
- python-kadmin-rs
version:
description: Version to release
required: true
type: string

jobs:
release-pr:
permissions:
id-token: write
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: chainguard-dev/actions/setup-gitsign@main
- uses: taiki-e/install-action@v1
with:
tool: cargo-release
- uses: cargo-bins/release-pr@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ inputs.version }}
crate-name: ${{ inputs.package }}
pr-label: release
pr-release-notes: true
# From https://api.github.com/users/authentik-automation[bot]
git-user-name: authentik-automation[bot]
git-user-email: 135050075+authentik-automation[bot]@users.noreply.github.com
5 changes: 5 additions & 0 deletions python-kadmin-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ pyo3 = { version = "0.22", features = ["extension-module"] }

[lints]
workspace = true

[package.metadata.release]
pre-release-replacements = [
{ file = "../pyproject.toml", search = "^version = \"[a-z0-9\\.-]+\"", replace = "version = \"{{ version }}\"", exactly = 1 },
]

0 comments on commit ceb66b5

Please sign in to comment.