diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ad2655a..25472eb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,21 +53,28 @@ jobs: git_committer_name: ${{ secrets.BUMP_GIT_NAME }} git_committer_email: ${{ secrets.BUMP_GIT_EMAIL }} github_token: ${{ secrets.GH_TOKEN }} - sync_main_to_v1: + sync_release_to_vx: if: | always() && (needs.semantic-release.result == 'success' || needs.semantic-release.result == 'skipped') && - (startsWith(github.ref, 'refs/tags/v1') && !contains(github.ref, 'beta')) - name: Sync branch `main` to `v1` (fast-forward enabled) + (startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'beta')) + name: Sync new release to `vx`-branch runs-on: ubuntu-latest needs: - semantic-release steps: - - name: Keep `v1` up to date with `main` (fast-forward enabled) + - name: Get version + id: version + run: echo ::set-output name=version::${GITHUB_REF#refs/tags/} + - name: Get major version + id: major + run: version=${{ steps.version.outputs.version }} && echo ::set-output name=major::${version%%.*} + - name: Keep `vx` up to date with new release uses: jojomatik/sync-branch@beta with: - source: "main" - target: "v1" + source: ${{ github.ref }} + target: ${{ format('refs/heads/{0}', steps.major.outputs.major) }} + strategy: "fail" git_committer_name: ${{ secrets.BUMP_GIT_NAME }} git_committer_email: ${{ secrets.BUMP_GIT_EMAIL }} - github_token: ${{ secrets.GH_TOKEN }} \ No newline at end of file + github_token: ${{ secrets.GH_TOKEN }}