From ccd4d7e18e3604df2646c96209228bcb4abc3a96 Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 22 Dec 2023 22:44:49 +0100 Subject: [PATCH] chore: run releases on separate release branch --- .github/workflows/documentation.yml | 9 +++++++-- .github/workflows/nightly.yml | 12 +++++++++--- .github/workflows/release.yml | 9 ++++++++- .github/workflows/website.yml | 9 +++++++-- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8d88aad27f..76b4f296e3 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -2,11 +2,14 @@ name: Deploy updated templates env: GO_VERSION: ^1.21 + BRANCH: release on: push: - branches: [master] - paths: ["templates/**"] + branches: + - "{{ $env.BRANCH }}" + paths: + - templates/** workflow_dispatch: jobs: @@ -16,6 +19,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: refs/heads/{{ $env.BRANCH }} - uses: actions/setup-go@v4 with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 432535d2b1..f112cc6050 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,6 +2,7 @@ name: Nightly Build env: GO_VERSION: ^1.21 + BRANCH: master on: schedule: # runs on the default branch: master @@ -16,6 +17,10 @@ jobs: should_run: ${{ steps.should_run.outputs.should_run }} steps: - uses: actions/checkout@v4 + with: + ref: refs/heads/{{ $env.BRANCH }} + fetch-depth: 0 + - name: print latest_commit run: echo ${{ github.sha }} @@ -30,9 +35,9 @@ jobs: needs: check_date if: | ${{ needs.check_date.outputs.should_run != 'false' }} - && startsWith(github.ref, 'refs/heads/master') + && startsWith(github.ref, 'refs/heads/{{ $env.BRANCH }}') && ! contains(github.head_ref, 'refs/heads/chore/') - uses: evcc-io/evcc/.github/workflows/default.yml@master + uses: evcc-io/evcc/.github/workflows/default.yml@{{ $env.BRANCH }} docker: name: Publish Docker :nightly @@ -43,7 +48,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: refs/heads/master # force master + ref: refs/heads/{{ $env.BRANCH }} fetch-depth: 0 - name: Get dist from cache @@ -80,6 +85,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + ref: refs/heads/{{ $env.BRANCH }} fetch-depth: 0 - uses: actions/setup-go@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e6c2f47dc..b56deb1d68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,7 @@ name: Release env: GO_VERSION: ^1.21 + BRANCH: release on: push: @@ -11,7 +12,7 @@ on: jobs: call-build-workflow: if: startsWith(github.ref, 'refs/tags') - uses: evcc-io/evcc/.github/workflows/default.yml@master + uses: evcc-io/evcc/.github/workflows/default.yml@{{ $env.BRANCH }} docker: name: Publish Docker :release @@ -22,6 +23,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + ref: refs/heads/{{ $env.BRANCH }} fetch-depth: 0 - name: Login @@ -58,6 +60,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + ref: refs/heads/{{ $env.BRANCH }} fetch-depth: 0 - name: Setup Go @@ -116,6 +119,10 @@ jobs: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} steps: - uses: actions/checkout@v4 + with: + ref: refs/heads/{{ $env.BRANCH }} + fetch-depth: 0 + - uses: superfly/flyctl-actions/setup-flyctl@master - run: flyctl deploy --local-only --config packaging/fly.toml diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index c23d17575b..9d177a7909 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -2,11 +2,14 @@ name: Deploy data to website env: GO_VERSION: ^1.21 + BRANCH: release on: push: - branches: [master] - paths: ["templates/evcc.io/**"] + branches: + - "{{ $env.BRANCH }}" + paths: + - templates/evcc.io/** workflow_dispatch: jobs: @@ -16,6 +19,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: refs/heads/{{ $env.BRANCH }} - uses: actions/setup-go@v4 with: