Repository navigation
nightly #23
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
| # Nightly: pin the OpenMS formulae (libopenms, openms, openms-gui) to the OpenMS `nightly` branch, build bottles | |
| # with the `brew test-bot` build commands and publish them with `brew pr-upload`, i.e. the same | |
| # tooling Homebrew uses, minus the pull request round-trip. | |
| # | |
| # Triggered by OpenMS/OpenMS's "Update nightly from develop" workflow via | |
| # repository_dispatch (event type `openms-nightly`), with a daily fallback. | |
| # Runs on the default branch so the ccache it saves is visible to every later run. | |
| name: nightly | |
| on: | |
| repository_dispatch: | |
| types: [openms-nightly] | |
| schedule: | |
| - cron: "0 4 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| sha: | |
| description: OpenMS commit to build (default - tip of the nightly branch) | |
| required: false | |
| force: | |
| description: Rebuild even if the formula already points at this commit | |
| type: boolean | |
| default: false | |
| permissions: {} | |
| defaults: | |
| run: | |
| shell: bash -xeuo pipefail {0} | |
| concurrency: | |
| group: nightly | |
| cancel-in-progress: false | |
| env: | |
| STAGING_BRANCH: nightly-staging | |
| jobs: | |
| bump: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| outputs: | |
| changed: ${{ steps.bump.outputs.changed }} | |
| version: ${{ steps.bump.outputs.version }} | |
| ref: ${{ steps.push.outputs.ref }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: main | |
| persist-credentials: true | |
| - name: Pin formulae to OpenMS nightly | |
| id: bump | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| SHA: ${{ inputs.sha || github.event.client_payload.sha }} | |
| FORCE: ${{ inputs.force }} | |
| run: | | |
| python3 .github/scripts/bump-nightly.py --sha "$SHA" | tee -a "$GITHUB_OUTPUT" | |
| if [[ "$FORCE" == "true" ]]; then echo "changed=true" >> "$GITHUB_OUTPUT"; fi | |
| - name: Push staging commit | |
| id: push | |
| if: steps.bump.outputs.changed == 'true' | |
| env: | |
| VERSION: ${{ steps.bump.outputs.version }} | |
| OPENMS_SHA: ${{ steps.bump.outputs.sha }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| if ! git diff --quiet; then | |
| git commit -am "libopenms, openms, openms-gui ${VERSION}" -m "Built from OpenMS/OpenMS@${OPENMS_SHA}." | |
| fi | |
| git push --force origin "HEAD:refs/heads/${STAGING_BRANCH}" | |
| echo "ref=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" | |
| bottles: | |
| needs: bump | |
| if: needs.bump.outputs.changed == 'true' | |
| permissions: | |
| actions: read | |
| checks: read | |
| contents: read | |
| packages: read | |
| pull-requests: read | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| ref: ${{ needs.bump.outputs.ref }} | |
| formulae: openms/openms/libopenms openms/openms/openms openms/openms/openms-gui | |
| save-cache: true | |
| publish: | |
| needs: [bump, bottles] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| attestations: write | |
| contents: write | |
| id-token: write | |
| packages: write | |
| steps: | |
| - name: Set up Homebrew | |
| id: set-up-homebrew | |
| uses: Homebrew/actions/setup-homebrew@e99025eb970cfa124b8284a35463d87426917478 # 2026.09.28.1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up git | |
| id: git_setup | |
| uses: Homebrew/actions/git-user-config@e99025eb970cfa124b8284a35463d87426917478 # 2026.09.28.1 | |
| - name: Check out staging commit | |
| working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }} | |
| env: | |
| REF: ${{ needs.bump.outputs.ref }} | |
| run: | | |
| git fetch origin "$REF" | |
| git checkout --force -B main FETCH_HEAD | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| pattern: bottles_* | |
| path: ${{ runner.temp }}/bottles | |
| merge-multiple: true | |
| - name: Upload bottles and commit bottle block | |
| env: | |
| HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| HOMEBREW_GIT_COMMITTER_NAME: ${{ steps.git_setup.outputs.name }} | |
| HOMEBREW_GIT_COMMITTER_EMAIL: ${{ steps.git_setup.outputs.email }} | |
| HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.repository_owner }} | |
| working-directory: ${{ runner.temp }}/bottles | |
| run: | | |
| ls -la | |
| brew pr-upload --debug --root-url=https://ghcr.io/v2/openms/openms | |
| - name: Generate build provenance | |
| uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 | |
| with: | |
| subject-path: "${{ runner.temp }}/bottles/*.tar.gz" | |
| - name: Push commits | |
| uses: Homebrew/actions/git-try-push@e99025eb970cfa124b8284a35463d87426917478 # 2026.09.28.1 | |
| with: | |
| branch: main | |
| directory: ${{ steps.set-up-homebrew.outputs.repository-path }} |