From fa28d0ec5c1e0226f14f69a56cb89d96df3348e3 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 21:36:59 +0700 Subject: [PATCH 01/19] ci-cd --- .github/workflows/release_new_version.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index 342e67f..d1c0e41 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -29,3 +29,7 @@ jobs: with: body: ${{steps.github_release.outputs.changelog}} tag_name: ${{ steps.semver_rel.outputs.new_tag }} + - name: Backup to bitbucket + shell: bash + run: :| + ls From 03dc5cf4f7ab56c9b0306b8a170b9c398caf6fd3 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 21:40:30 +0700 Subject: [PATCH 02/19] change .yaml --- .github/workflows/release_new_version.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index d1c0e41..be633e8 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -2,7 +2,7 @@ name: Release New Version on: push: - branches: ["master"] + branches: ["backup"] jobs: release: @@ -31,5 +31,5 @@ jobs: tag_name: ${{ steps.semver_rel.outputs.new_tag }} - name: Backup to bitbucket shell: bash - run: :| + run: | ls From c16a08e7b1fe9a78fd891e9edaab7c64a0e750bf Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 21:45:21 +0700 Subject: [PATCH 03/19] remote to bitbucket --- .github/workflows/release_new_version.yaml | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index be633e8..af16ddd 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -11,25 +11,8 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - - name: Calculate Semver - id: semver_rel - uses: hennejg/github-tag-action@v4.3.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Changelog Builder - id: github_release - uses: mikepenz/release-changelog-builder-action@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fromTag: ${{ steps.semver_rel.outputs.previous_tag }} - toTag: ${{ steps.semver_rel.outputs.new_tag }} - - name: Create Github Release - uses: mikepenz/action-gh-release@v0.2.0-a03 - with: - body: ${{steps.github_release.outputs.changelog}} - tag_name: ${{ steps.semver_rel.outputs.new_tag }} - name: Backup to bitbucket shell: bash run: | - ls + git remote add bitbucket https://bitbucket.org/softpro-workworkwork/common-go/src/master/ + git push --mirror bitbucket From 5cb6beb6bfe8db30aa2da66b6569bbb018e9fb20 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 21:47:23 +0700 Subject: [PATCH 04/19] fix yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index af16ddd..506d4b4 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add bitbucket https://bitbucket.org/softpro-workworkwork/common-go/src/master/ + git remote add bitbucket https://TaninDean@bitbucket.org/softpro-workworkwork/common-go.git git push --mirror bitbucket From 8c515ff312e90daffb9b193c1b2a914dd0628ade Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:14:26 +0700 Subject: [PATCH 05/19] fix yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index 506d4b4..87cb72b 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add bitbucket https://TaninDean@bitbucket.org/softpro-workworkwork/common-go.git + git remote add bitbucket https://TaninDean:${{BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git git push --mirror bitbucket From f91588e88467346a563a897183fb01efce11a153 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:15:23 +0700 Subject: [PATCH 06/19] fix yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index 87cb72b..203f6d7 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add bitbucket https://TaninDean:${{BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git + git remote add bitbucket https://TaninDean:${{bitbucket}}@bitbucket.org/softpro-workworkwork/common-go.git git push --mirror bitbucket From 2045055b64d0fa75b4441f1417cedfe4e9e9887e Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:17:36 +0700 Subject: [PATCH 07/19] fix: yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index 203f6d7..cdf3e6a 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add bitbucket https://TaninDean:${{bitbucket}}@bitbucket.org/softpro-workworkwork/common-go.git + git remote add bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git git push --mirror bitbucket From 8e2f4bf45ffdce88b8da465c1aa7a0a7df1de53d Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:23:59 +0700 Subject: [PATCH 08/19] fix: yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index cdf3e6a..b7246b1 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git + git remote add --mirror bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git git push --mirror bitbucket From f7d6fd695638c50ae0f73e2e48d2668ca9da2d99 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:25:41 +0700 Subject: [PATCH 09/19] fix: yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index b7246b1..6f3a5d4 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add --mirror bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git + git remote add --mirror=push bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git git push --mirror bitbucket From fa35f227597c5b67f5b659d11a5f940f8b66ad35 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:26:38 +0700 Subject: [PATCH 10/19] fix: yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index 6f3a5d4..71d18d3 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add --mirror=push bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git + git remote add --fetch bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git git push --mirror bitbucket From e38e0b76caab0264b5aede9d247628ea42e331da Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:29:48 +0700 Subject: [PATCH 11/19] fix:yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index 71d18d3..fc64d5d 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add --fetch bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git + git remote add bitbucket git@bitbucket.org:softpro-workworkwork/common-go.git git push --mirror bitbucket From 866d0e3319bc0b2224730b06378093ff09bcd284 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:32:37 +0700 Subject: [PATCH 12/19] fix:yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index fc64d5d..200e3a8 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add bitbucket git@bitbucket.org:softpro-workworkwork/common-go.git + git remote add origin bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git git push --mirror bitbucket From 92b2322c4301852ea38acfb5c47beff80b362a41 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:41:28 +0700 Subject: [PATCH 13/19] fix: yaml --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index 200e3a8..cdf3e6a 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -14,5 +14,5 @@ jobs: - name: Backup to bitbucket shell: bash run: | - git remote add origin bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git + git remote add bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git git push --mirror bitbucket From d87eb8e0fccb60b86aa533f679174d9f23c0da78 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:52:04 +0700 Subject: [PATCH 14/19] fix: yaml --- .github/workflows/release_new_version.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index cdf3e6a..eb76ee8 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -12,7 +12,15 @@ jobs: with: fetch-depth: 0 - name: Backup to bitbucket - shell: bash - run: | - git remote add bitbucket https://TaninDean:${{secrets.BITBUCKET}}@bitbucket.org/softpro-workworkwork/common-go.git - git push --mirror bitbucket + to_gitlab: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git clone git@bitbucket.org:softpro-workworkwork/common-go.git + ssh_private_key: + ${{ secrets.BITBUCKET }} From e8ccbf516e6a8ac7992126ca329cfbf78246dc03 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:53:14 +0700 Subject: [PATCH 15/19] fix: yaml --- .github/workflows/release_new_version.yaml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index eb76ee8..c1f09b8 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -11,16 +11,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Backup to bitbucket - to_gitlab: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: - git clone git@bitbucket.org:softpro-workworkwork/common-go.git - ssh_private_key: - ${{ secrets.BITBUCKET }} + - name: Backup to bitbucket + - uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git clone git@bitbucket.org:softpro-workworkwork/common-go.git + ssh_private_key: + ${{ secrets.BITBUCKET }} From 5f86307e19843457ac8b1442aa6e224fa0996af3 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 22:55:38 +0700 Subject: [PATCH 16/19] fix: yaml --- .github/workflows/release_new_version.yaml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index c1f09b8..eb1748a 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -11,10 +11,15 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Backup to bitbucket - - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: - git clone git@bitbucket.org:softpro-workworkwork/common-go.git - ssh_private_key: - ${{ secrets.BITBUCKET }} + to_gitlab: + runs-on: ubuntu-latest + steps: # <-- must use actions/checkout before mirroring! + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git clone git@bitbucket.org:softpro-workworkwork/common-go.git + ssh_private_key: + ${{ secrets.BITBUCKET }} From a423e964d0a3457bf255f8f08b79d2f5d3787835 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 23:03:22 +0700 Subject: [PATCH 17/19] fix: action error --- .github/workflows/release_new_version.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index eb1748a..594eebd 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -11,9 +11,27 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Calculate Semver + id: semver_rel + uses: hennejg/github-tag-action@v4.3.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Changelog Builder + id: github_release + uses: mikepenz/release-changelog-builder-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fromTag: ${{ steps.semver_rel.outputs.previous_tag }} + toTag: ${{ steps.semver_rel.outputs.new_tag }} + - name: Create Github Release + uses: mikepenz/action-gh-release@v0.2.0-a03 + with: + body: ${{steps.github_release.outputs.changelog}} + tag_name: ${{ steps.semver_rel.outputs.new_tag }} + to_gitlab: runs-on: ubuntu-latest - steps: # <-- must use actions/checkout before mirroring! + steps: - uses: actions/checkout@v3 with: fetch-depth: 0 From 6f38910659a3889670c3987aa4e0ce08b3f07591 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 23:04:33 +0700 Subject: [PATCH 18/19] fix: work when master updated --- .github/workflows/release_new_version.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index 594eebd..c2959de 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -2,7 +2,7 @@ name: Release New Version on: push: - branches: ["backup"] + branches: ["master"] jobs: release: @@ -28,7 +28,7 @@ jobs: with: body: ${{steps.github_release.outputs.changelog}} tag_name: ${{ steps.semver_rel.outputs.new_tag }} - + to_gitlab: runs-on: ubuntu-latest steps: From 9339bbe0f5c651ec0143153287b9947f1b718843 Mon Sep 17 00:00:00 2001 From: TaninDean Date: Wed, 23 Nov 2022 23:19:52 +0700 Subject: [PATCH 19/19] change job file --- .github/workflows/release_new_version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_new_version.yaml b/.github/workflows/release_new_version.yaml index c2959de..a56caf0 100644 --- a/.github/workflows/release_new_version.yaml +++ b/.github/workflows/release_new_version.yaml @@ -29,7 +29,7 @@ jobs: body: ${{steps.github_release.outputs.changelog}} tag_name: ${{ steps.semver_rel.outputs.new_tag }} - to_gitlab: + backup to bitbucket: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3