Rolling release #1076
This file contains hidden or 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: Rolling release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "*/15 * * * *" | |
permissions: | |
contents: write | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- id: app-token | |
uses: actions/create-github-app-token@v2 | |
with: | |
app-id: ${{ secrets.GH_APP_ID }} | |
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
- id: get-user-id | |
name: Get GitHub app user ID | |
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
env: | |
GH_TOKEN: "${{ steps.app-token.outputs.token }}" | |
- name: Check out code | |
uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 | |
token: "${{ steps.app-token.outputs.token }}" | |
path: client-rust | |
- name: Setup rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Fetch schema | |
uses: actions/checkout@v5 | |
with: | |
repository: goauthentik/authentik | |
token: "${{ steps.app-token.outputs.token }}" | |
ref: main | |
path: authentik | |
sparse-checkout: | | |
schema.yml | |
sparse-checkout-cone-mode: false | |
- name: Publish | |
working-directory: client-rust | |
run: | | |
version="$(yq -r '.info.version' ../authentik/schema.yml).$(date +%s)" | |
make version="$version" | |
[ "$(wc -l < diff.test)" -lt 4 ] && exit 0 || echo | |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]' | |
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com' | |
git add . | |
git commit -F "diff.test" || exit 0 | |
git tag v$version | |
git push | |
git push --tags | |
cargo publish | |
truncate -s '<125000' diff.test | |
gh release create v$version -F diff.test --prerelease | |
env: | |
GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
RUSTFLAGS: -Awarnings |