Skip to content

Rolling release

Rolling release #9067

Workflow file for this run

---
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@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
token: "${{ steps.app-token.outputs.token }}"
path: client-rust
- name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
- name: Fetch schema
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: goauthentik/authentik
token: "${{ steps.app-token.outputs.token }}"
ref: main
path: authentik
sparse-checkout: |
schema.yml
sparse-checkout-cone-mode: false
- id: changes
name: Check for changes
working-directory: client-rust
run: |
cp ../authentik/schema.yml schema.yml
if git diff --exit-code -- schema.yml > /dev/null; then
echo "schema_has_changes=false" >> "$GITHUB_OUTPUT"
else
echo "schema_has_changes=true" >> "$GITHUB_OUTPUT"
fi
- name: Publish
if: "${{ steps.changes.outputs.schema_has_changes == 'true' }}"
working-directory: client-rust
run: |
version="$(yq -r '.info.version' ../authentik/schema.yml).$(date +%s)"
make version="$version"
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