Update Datomic Version #58
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: Update Datomic Version | |
| on: | |
| schedule: | |
| - cron: "0 8 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: DeterminateSystems/determinate-nix-action@v3 | |
| - uses: DeterminateSystems/flakehub-cache-action@main | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Check for updates | |
| id: release | |
| run: | | |
| nix develop --command bb release:build | |
| if git diff --quiet pkgs/versions.nix README.adoc doc/modules/ROOT/pages/index.adoc doc/modules/ROOT/pages/nixos-module.adoc doc/modules/ROOT/pages/docker-oci-container.adoc CHANGELOG.adoc SECURITY.adoc doc/modules/ROOT/pages/changelog.adoc doc/modules/ROOT/pages/security.adoc doc/modules/ROOT/nav.adoc nixos-modules/datomic-pro.nix; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| echo "version=$(nix eval --raw .#datomic-pro.version)" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create PR | |
| if: steps.release.outputs.changed == 'true' | |
| run: | | |
| BRANCH="auto-update/datomic-${{ steps.release.outputs.version }}" | |
| git config user.name "Casey Link" | |
| git config user.email "14830+Ramblurr@users.noreply.github.com" | |
| git remote set-url origin "https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}.git" | |
| git push origin --delete "$BRANCH" 2>/dev/null || true | |
| git checkout -b "$BRANCH" | |
| git add pkgs/versions.nix README.adoc doc/modules/ROOT/pages/index.adoc doc/modules/ROOT/pages/nixos-module.adoc doc/modules/ROOT/pages/docker-oci-container.adoc CHANGELOG.adoc SECURITY.adoc doc/modules/ROOT/pages/changelog.adoc doc/modules/ROOT/pages/security.adoc doc/modules/ROOT/nav.adoc nixos-modules/datomic-pro.nix | |
| git commit -m "add datomic-pro ${{ steps.release.outputs.version }}" | |
| git push -u origin "$BRANCH" | |
| gh pr create \ | |
| --title "Add datomic-pro ${{ steps.release.outputs.version }}" \ | |
| --body "Automated update to Datomic Pro ${{ steps.release.outputs.version }}" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} |