From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Thu, 29 Sep 2022 11:46:05 +0000 (+0100) Subject: Add docker-build-on-formal-release.yaml and stale.yaml to the branch. X-Git-Tag: 4.1-rc2~1^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44c5f18b0e640138328ca4574ebafb7f4416242e;p=thirdparty%2Fshairport-sync.git Add docker-build-on-formal-release.yaml and stale.yaml to the branch. --- diff --git a/.github/workflows/docker-build-on-formal-release.yaml b/.github/workflows/docker-build-on-formal-release.yaml new file mode 100644 index 00000000..fc698373 --- /dev/null +++ b/.github/workflows/docker-build-on-formal-release.yaml @@ -0,0 +1,83 @@ +# Builds & pushes a docker image when a "formal" release tag of the format X, X.Y or X.Y.Z occurs, where X, Y and Z are all numbers. +# It seems this yaml has to exist on the branch the tag refers to. + +# Thanks to Charles Omer for the workfow upon which this is based. + +# The following docker tags are created & pushed: +# trial, trial-classic +# not building 'latest' yet... + +name: Formal (X, X.Y or X.Y.Z) release tags -- docker build and push. + +on: + push: + tags: + - '[0-9]+\.[0-9]+\.[0-9]+' # e.g. 8.9.0 + - '[0-9]+\.[0-9]+' # e.g. 8.9 + - '[0-9]+' # e.g. 8 + - '[0-9]+\.[0-9]+rc[0-9]+' # e.g. 4.1rc0 + +env: + DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7 + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set SHAIRPORT_SYNC_BRANCH env. + run: | + raw=$(git branch -r --contains ${{ github.ref }}) + branch=${raw##*/} + echo "SHAIRPORT_SYNC_BRANCH=${branch}" >> $GITHUB_ENV + + - name: Set tag env + run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Determine NQPTP env (part 1). + if: ${{ env.SHAIRPORT_SYNC_BRANCH == 'development' }} + run: echo "NQPTP_BRANCH=development" >> $GITHUB_ENV + + - name: Determine NQPTP env (part 2). + if: ${{ env.SHAIRPORT_SYNC_BRANCH != 'development' }} + run: echo "NQPTP_BRANCH=main" >> $GITHUB_ENV + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./docker/Dockerfile + platforms: ${{ env.DOCKER_PLATFORMS }} + push: true + tags: trial + build-args: | + SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }} + NQPTP_BRANCH=${{ env.NQPTP_BRANCH }} + + - name: Build and push (Classic) + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./docker/classic/Dockerfile + platforms: ${{ env.DOCKER_PLATFORMS }} + push: true + tags: trial-classic + build-args: | + SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }} diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 00000000..51658c01 --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,21 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '0 0 * * *' + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v4 + with: + stale-issue-message: 'This issue has been inactive for 45 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.' + stale-pr-message: 'This PR has been inactive for 45 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.' + operations-per-run: 100 + # These are the defaults at the time of writing. https://github.com/marketplace/actions/close-stale-issues + # days-before-stale: 45 + # days-before-close: 7