From db7f3dcae8a9b0726e13146194e8a026fed22a1b Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Wed, 29 Nov 2023 10:37:38 -0400 Subject: [PATCH 1/5] ci: add Release Please (#2019) --- .github/workflows/release-please.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 000000000..e3068b5bc --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,17 @@ +name: Publish release + +on: + push: + branches: [dev] + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: php + package-name: accessibility-exchange/platform + pull-request-title-pattern: "chore(release): release${component} ${version}" From 58b4a9c211ef5105ff6df0d7fc1fab4420757645 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Wed, 29 Nov 2023 10:51:57 -0400 Subject: [PATCH 2/5] ci: sync new releases to production and staging (#2019) --- .github/workflows/sync-to-production.yml | 17 +++++++++++++++++ .github/workflows/sync-to-staging.yml | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/sync-to-production.yml create mode 100644 .github/workflows/sync-to-staging.yml diff --git a/.github/workflows/sync-to-production.yml b/.github/workflows/sync-to-production.yml new file mode 100644 index 000000000..78c6b016e --- /dev/null +++ b/.github/workflows/sync-to-production.yml @@ -0,0 +1,17 @@ +name: Sync release to production + +on: + release: + types: [released] + +jobs: + sync-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Open pull request to production + uses: tretuna/sync-branches@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FROM_BRANCH: ${{ github.event.release.tag_name }} + TO_BRANCH: "production" diff --git a/.github/workflows/sync-to-staging.yml b/.github/workflows/sync-to-staging.yml new file mode 100644 index 000000000..40bdb5139 --- /dev/null +++ b/.github/workflows/sync-to-staging.yml @@ -0,0 +1,17 @@ +name: Sync release to staging + +on: + release: + types: [prereleased, released] + +jobs: + sync-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Open pull request to staging + uses: tretuna/sync-branches@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FROM_BRANCH: ${{ github.event.release.tag_name }} + TO_BRANCH: "staging" From 8f7c9ecc334ad46f2e04c7ff374ddde3ca173834 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Wed, 29 Nov 2023 10:56:36 -0400 Subject: [PATCH 3/5] ci: set PR titles --- .github/workflows/sync-to-production.yml | 1 + .github/workflows/sync-to-staging.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/sync-to-production.yml b/.github/workflows/sync-to-production.yml index 78c6b016e..1d8f535d7 100644 --- a/.github/workflows/sync-to-production.yml +++ b/.github/workflows/sync-to-production.yml @@ -15,3 +15,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FROM_BRANCH: ${{ github.event.release.tag_name }} TO_BRANCH: "production" + PULL_REQUEST_TITLE: "chore(release): sync ${{ github.event.release.tag_name }} to production" diff --git a/.github/workflows/sync-to-staging.yml b/.github/workflows/sync-to-staging.yml index 40bdb5139..be31cc626 100644 --- a/.github/workflows/sync-to-staging.yml +++ b/.github/workflows/sync-to-staging.yml @@ -15,3 +15,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FROM_BRANCH: ${{ github.event.release.tag_name }} TO_BRANCH: "staging" + PULL_REQUEST_TITLE: "chore(release): sync ${{ github.event.release.tag_name }} to staging" From 5e49d249693d4443505af58dcfc1777f82ae943f Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Wed, 29 Nov 2023 11:03:11 -0400 Subject: [PATCH 4/5] ci: remove component from PR title --- .github/workflows/release-please.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index e3068b5bc..6bc013d51 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -14,4 +14,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} release-type: php package-name: accessibility-exchange/platform - pull-request-title-pattern: "chore(release): release${component} ${version}" + pull-request-title-pattern: "chore(release): release ${version}" From c6ee37ffcaefc19118615de1f7f5a6c2adfd18bb Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Wed, 29 Nov 2023 11:24:32 -0400 Subject: [PATCH 5/5] ci: adjustments based on review --- .github/workflows/release-please.yml | 1 + .github/workflows/sync-to-production.yml | 10 ++++++++-- .github/workflows/sync-to-staging.yml | 12 +++++++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6bc013d51..2541bbfcb 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,6 +1,7 @@ name: Publish release on: + workflow_dispatch: push: branches: [dev] diff --git a/.github/workflows/sync-to-production.yml b/.github/workflows/sync-to-production.yml index 1d8f535d7..111683754 100644 --- a/.github/workflows/sync-to-production.yml +++ b/.github/workflows/sync-to-production.yml @@ -1,6 +1,12 @@ name: Sync release to production on: + workflow_dispatch: + inputs: + version: + description: 'Version' + required: true + type: string release: types: [released] @@ -13,6 +19,6 @@ jobs: uses: tretuna/sync-branches@v1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FROM_BRANCH: ${{ github.event.release.tag_name }} + FROM_BRANCH: ${{ inputs.version || github.event.release.tag_name }} TO_BRANCH: "production" - PULL_REQUEST_TITLE: "chore(release): sync ${{ github.event.release.tag_name }} to production" + PULL_REQUEST_TITLE: "chore(release): sync ${{ inputs.version || github.event.release.tag_name }} to production" diff --git a/.github/workflows/sync-to-staging.yml b/.github/workflows/sync-to-staging.yml index be31cc626..a6d216390 100644 --- a/.github/workflows/sync-to-staging.yml +++ b/.github/workflows/sync-to-staging.yml @@ -1,8 +1,14 @@ name: Sync release to staging on: + workflow_dispatch: + inputs: + version: + description: 'Version' + required: true + type: string release: - types: [prereleased, released] + types: [published] jobs: sync-release: @@ -13,6 +19,6 @@ jobs: uses: tretuna/sync-branches@v1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FROM_BRANCH: ${{ github.event.release.tag_name }} + FROM_BRANCH: ${{ inputs.version || github.event.release.tag_name }} TO_BRANCH: "staging" - PULL_REQUEST_TITLE: "chore(release): sync ${{ github.event.release.tag_name }} to staging" + PULL_REQUEST_TITLE: "chore(release): sync ${{ inputs.version || github.event.release.tag_name }} to staging"