diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml deleted file mode 100644 index 7bbeaa6..0000000 --- a/.github/workflows/build-test-release.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build and release -on: [push, pull_request] -jobs: - build-test: - uses: cygporter/workflows/.github/workflows/build-test.yml@v2 - with: - cygport_file: git.cygport - - github-release: - if: github.ref == format('refs/heads/v{0}', needs.build-test.outputs.cygport-pv) - needs: build-test - permissions: - contents: write - uses: cygporter/workflows/.github/workflows/github-release.yml@v2 - with: - tag_name: v${{ needs.build-test.outputs.cygport-pvr }} - - cygwin-release: - if: github.ref == format('refs/heads/v{0}', needs.build-test.outputs.cygport-pv) - needs: [build-test, github-release] - uses: cygporter/workflows/.github/workflows/cygwin-release.yml@v2 - with: - cygport_file: git.cygport - tag_name: v${{ needs.build-test.outputs.cygport-pvr }} - secrets: - maintainer_key: ${{ secrets.maintainer_key }} diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 27dc28d..5587b33 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -2,13 +2,34 @@ name: Daily build of latest release -on: - schedule: - # Randomly generated time. - - cron: '46 5 * * *' +on: push jobs: + # I'm sure there's a more lightweight way to do this, but I'm not sure what + # it is... + decide-branches: + name: Decide branches to test + outputs: + branches: ${{ steps.branches.outputs.branches }} + runs-on: ubuntu-latest + steps: + # Produce a JSON array of the branches that both exist and which I want + # to build regularly if they do exist. + - name: Report branches to build + id: branches + run: | + git ls-remote --heads "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" | + cut -f2 | + grep -e '^refs/heads/main$' -e '^refs/heads/rc$' | + jq -Rrs 'rtrimstr("\n") | split("\n") | @json "branches=\(.)"' >> "$GITHUB_OUTPUT" + build-test: - uses: cygporter/workflows/.github/workflows/build-test.yml@v2 + uses: cygporter/workflows/.github/workflows/build-test.yml@accept-ref + needs: decide-branches + strategy: + matrix: + branch: ${{ fromJSON(needs.decide-branches.outputs.branches) }} + fail-fast: false with: cygport_file: git.cygport + ref: ${{ matrix.branch }}