From fa948658505bfa134652832133154e4116ca6b26 Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Thu, 3 Aug 2023 15:09:19 +0200 Subject: [PATCH 01/12] feat: add new ci --- ...ate-release-develop-with-docker-build.yaml | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 .github/workflows/create-release-develop-with-docker-build.yaml diff --git a/.github/workflows/create-release-develop-with-docker-build.yaml b/.github/workflows/create-release-develop-with-docker-build.yaml new file mode 100644 index 00000000..9726c3a4 --- /dev/null +++ b/.github/workflows/create-release-develop-with-docker-build.yaml @@ -0,0 +1,128 @@ +name: Create tag with -rc for develop without release note + +on: + push: + branches: + - v2-testDevelopCi + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: Use Node.js 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + - run: yarn --frozen-lockfile + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + - run: yarn + - run: yarn build + - name: Upload build + uses: actions/upload-artifact@v3 + with: + name: build + path: build + + check-version: + needs: [install, build] + runs-on: ubuntu-latest + outputs: + release-version: ${{ steps.version.outputs.version }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get version + id: version + run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT + + - name: Print version + run: echo ${{ steps.version.outputs.version }} + + - uses: mukunku/tag-exists-action@v1.2.0 + name: Check tag existence + id: check-tag-exists + with: + tag: ${{ steps.version.outputs.version }}-rc + + - if: ${{ steps.check-tag-exists.outputs.exists == 'false' }} + name: Check tag format + id: check-tag-format + run: | + if ! [[ "${{ steps.version.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo "is-tag-format-correct=false" >> $GITHUB_OUTPUT + fi + + - name: Tag verification + id: check-tag + run: | + if [[ "${{ steps.check-tag-exists.outputs.exists }}" == "true" ]]; then + echo "Nothing to tag/release, the tag ${{ steps.version.outputs.version }}-rc already exists" + exit 1 + fi + + if ! [[ "${{ steps.version.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo "Nothing to tag/release, the tag ${{ steps.version.outputs.version }}-rc is not in correct format X.Y.Z" + exit 1 + fi + + create-release: + needs: check-version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + fetch-depth: 0 + + - name: Get previous final release tag + id: previousTag + run: | + previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$" | tail -1) + if [ -z "$previousTag" ]; then + echo "previousTag=$(git rev-list --max-parents=0 HEAD)" >> $GITHUB_OUTPUT + else + echo "previousTag=$previousTag" >> $GITHUB_OUTPUT + fi + + - uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ needs.check-version.outputs.release-version }}-rc + target_commitish: ${{ github.head_ref || github.ref }} + name: ${{ needs.check-version.outputs.release-version }}-rc + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + docker: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Download build + id: download + uses: actions/download-artifact@v3 + with: + name: build + path: build + - name: Get current version + id: version + uses: notiz-dev/github-action-json-property@release + with: + path: "package.json" + prop_path: "version" + - run: echo ${{steps.version.outputs.prop}} + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: ${{ secrets.DOCKERHUB_REGISTRY_HOST }}/stromae + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + tags: ${{steps.version.outputs.prop}} From 8814b19a6b0f73fcc50dce3cf07c186ebadd5e3a Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Thu, 3 Aug 2023 15:13:02 +0200 Subject: [PATCH 02/12] fix: change node version to 16 in ci --- .../create-release-develop-with-docker-build.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create-release-develop-with-docker-build.yaml b/.github/workflows/create-release-develop-with-docker-build.yaml index 9726c3a4..2cc09dc7 100644 --- a/.github/workflows/create-release-develop-with-docker-build.yaml +++ b/.github/workflows/create-release-develop-with-docker-build.yaml @@ -9,20 +9,20 @@ jobs: install: runs-on: ubuntu-latest steps: - - name: Use Node.js 18 + - name: Use Node.js 16 uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 16 - run: yarn --frozen-lockfile build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Use Node.js 18 + - name: Use Node.js 16 uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 16 - run: yarn - run: yarn build - name: Upload build @@ -116,8 +116,8 @@ jobs: id: version uses: notiz-dev/github-action-json-property@release with: - path: "package.json" - prop_path: "version" + path: 'package.json' + prop_path: 'version' - run: echo ${{steps.version.outputs.prop}} - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@master From a9ffa0de479abf0917d4c6a04ee92fba111ce54e Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Thu, 3 Aug 2023 15:19:40 +0200 Subject: [PATCH 03/12] fix: create a 2.4.10 to test newci --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a7bb87f5..c67f073e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stromae", - "version": "2.4.9", + "version": "2.4.10", "description": "Web application for the management of questionnaires powered by Lunatic", "repository": { "type": "git", From c28a5fd0d44d9c06a45da569cb9ac1dac023ae6d Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Thu, 3 Aug 2023 15:36:35 +0200 Subject: [PATCH 04/12] fix: release test --- ...te-release-v2-develop-publish-docker.yaml} | 2 +- ...reate-release-v2-master-publish-docker.yml | 128 ++++++++++++++++++ .github/workflows/develop-release.yml | 72 ---------- .github/workflows/docker.yml | 14 +- .github/workflows/release.yml | 80 ----------- 5 files changed, 136 insertions(+), 160 deletions(-) rename .github/workflows/{create-release-develop-with-docker-build.yaml => create-release-v2-develop-publish-docker.yaml} (99%) create mode 100644 .github/workflows/create-release-v2-master-publish-docker.yml delete mode 100644 .github/workflows/develop-release.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/create-release-develop-with-docker-build.yaml b/.github/workflows/create-release-v2-develop-publish-docker.yaml similarity index 99% rename from .github/workflows/create-release-develop-with-docker-build.yaml rename to .github/workflows/create-release-v2-develop-publish-docker.yaml index 2cc09dc7..a3d30cc7 100644 --- a/.github/workflows/create-release-develop-with-docker-build.yaml +++ b/.github/workflows/create-release-v2-develop-publish-docker.yaml @@ -3,7 +3,7 @@ name: Create tag with -rc for develop without release note on: push: branches: - - v2-testDevelopCi + - v2-develop jobs: install: diff --git a/.github/workflows/create-release-v2-master-publish-docker.yml b/.github/workflows/create-release-v2-master-publish-docker.yml new file mode 100644 index 00000000..ea675f21 --- /dev/null +++ b/.github/workflows/create-release-v2-master-publish-docker.yml @@ -0,0 +1,128 @@ +name: Create tag for v2-master with release note + +on: + push: + branches: + - v2-testDevelopCi + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: Use Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + - run: yarn --frozen-lockfile + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + - run: yarn + - run: yarn build + - name: Upload build + uses: actions/upload-artifact@v3 + with: + name: build + path: build + + check-version: + needs: [install, build] + runs-on: ubuntu-latest + outputs: + release-version: ${{ steps.version.outputs.version }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get version + id: version + run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_ENV + + - name: Print version + run: echo ${{ steps.version.outputs.version }} + + - uses: mukunku/tag-exists-action@v1.2.0 + name: Check tag existence + id: check-tag-exists + with: + tag: ${{ steps.version.outputs.version }} + + - if: ${{ steps.check-tag-exists.outputs.exists == 'false' }} + name: Check tag format + id: check-tag-format + run: | + if ! [[ "${{ steps.version.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo "is-tag-format-correct=false" >> $GITHUB_ENV + fi + + - name: Tag verification + id: check-tag + run: | + if [[ "${{ steps.check-tag-exists.outputs.exists }}" == "true" ]]; then + echo "Nothing to tag/release, the tag ${{ steps.version.outputs.version }} already exists" + exit 1 + fi + + if ! [[ "${{ steps.version.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo "Nothing to tag/release, the tag ${{ steps.version.outputs.version }} is not in correct format X.Y.Z" + exit 1 + fi + + create-release: + needs: check-version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + fetch-depth: 0 + + - name: Get previous final release tag + id: previousTag + run: | + previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$" | tail -1) + if [ -z "$previousTag" ]; then + echo "previousTag=$(git rev-list --max-parents=0 HEAD)" >> $GITHUB_ENV + else + echo "previousTag=$previousTag" >> $GITHUB_ENV + fi + + - uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ needs.check-version.outputs.release-version }} + target_commitish: ${{ github.head_ref || github.ref }} + name: ${{ needs.check-version.outputs.release-version }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + docker: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Download build + id: download + uses: actions/download-artifact@v3 + with: + name: build + path: build + - name: Get current version + id: version + uses: notiz-dev/github-action-json-property@release + with: + path: 'package.json' + prop_path: 'version' + - run: echo ${{steps.version.outputs.prop}} + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: ${{ secrets.DOCKERHUB_REGISTRY_HOST }}/stromae + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + tags: ${{steps.version.outputs.prop}} diff --git a/.github/workflows/develop-release.yml b/.github/workflows/develop-release.yml deleted file mode 100644 index baa181cf..00000000 --- a/.github/workflows/develop-release.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Release Candidate - -on: - push: - branches: - - 'v2-develop' - tags: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 14 - uses: actions/setup-node@v1 - with: - node-version: 14 - - run: yarn - - run: yarn build - - name: Upload build - uses: actions/upload-artifact@v2 - with: - name: build - path: build - release: - runs-on: ubuntu-latest - steps: - - name: Checkout current branch - uses: actions/checkout@v2 - - name: Get current version - id: version - uses: notiz-dev/github-action-json-property@release - with: - path: 'package.json' - prop_path: 'version' - - run: echo ${{steps.version.outputs.prop}} - - name: Release snapshot - id: release-snapshot - uses: actions/create-release@latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{steps.version.outputs.prop}}-rc - release_name: Release Candidate ${{steps.version.outputs.prop}} - draft: false - prerelease: false - docker: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download build - id: download - uses: actions/download-artifact@v2 - with: - name: build - path: build - - name: Get current version - id: version - uses: notiz-dev/github-action-json-property@release - with: - path: 'package.json' - prop_path: 'version' - - run: echo ${{steps.version.outputs.prop}} - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: ${{ secrets.DOCKERHUB_REGISTRY_HOST }}/stromae - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: ${{steps.version.outputs.prop}}-rc diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c674068d..7bf9c5ce 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,15 +11,15 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Use Node.js 14 - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - name: Use Node.js 16 + uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 16 - run: yarn - run: yarn build - name: Upload build - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: build path: build @@ -27,10 +27,10 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Download build id: download - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: build path: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 18a6e069..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Release & Docker - -on: - push: - branches: - - 'v2-master' - tags: - - '*' - -jobs: - install: - runs-on: ubuntu-latest - steps: - - name: Use Node.js 14C - uses: actions/setup-node@v1 - with: - node-version: 14 - - run: yarn --frozen-lockfile - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 14 - uses: actions/setup-node@v1 - with: - node-version: 14 - - run: yarn - - run: yarn build - - name: Upload build - uses: actions/upload-artifact@v2 - with: - name: build - path: build - release: - runs-on: ubuntu-latest - steps: - - name: Checkout current branch - uses: actions/checkout@v2 - - name: Get current version - id: version - uses: notiz-dev/github-action-json-property@release - with: - path: 'package.json' - prop_path: 'version' - - run: echo ${{steps.version.outputs.prop}} - - name: Release snapshot - id: release-snapshot - uses: actions/create-release@latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{steps.version.outputs.prop}} - release_name: ${{steps.version.outputs.prop}} - draft: false - prerelease: false - docker: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download build - id: download - uses: actions/download-artifact@v2 - with: - name: build - path: build - - name: Get current version - id: version - uses: notiz-dev/github-action-json-property@release - with: - path: 'package.json' - prop_path: 'version' - - run: echo ${{steps.version.outputs.prop}} - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: ${{ secrets.DOCKERHUB_REGISTRY_HOST }}/stromae - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - tags: ${{steps.version.outputs.prop}} From c815f24914071465e6dd63e99b9a3007a09da7be Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Thu, 3 Aug 2023 16:08:56 +0200 Subject: [PATCH 05/12] fix: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c67f073e..46b78f8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stromae", - "version": "2.4.10", + "version": "2.4.11", "description": "Web application for the management of questionnaires powered by Lunatic", "repository": { "type": "git", From 17e89765cf77702d424cf3874ccef46b56594094 Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Thu, 3 Aug 2023 16:18:24 +0200 Subject: [PATCH 06/12] fix: test release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 46b78f8d..4c969258 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stromae", - "version": "2.4.11", + "version": "2.4.12", "description": "Web application for the management of questionnaires powered by Lunatic", "repository": { "type": "git", From bd801b93bfb470cf797061e87a236e90337d0d1b Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Thu, 3 Aug 2023 16:33:43 +0200 Subject: [PATCH 07/12] fix: version --- ...reate-release-v2-master-publish-docker.yml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/create-release-v2-master-publish-docker.yml b/.github/workflows/create-release-v2-master-publish-docker.yml index ea675f21..e4cec141 100644 --- a/.github/workflows/create-release-v2-master-publish-docker.yml +++ b/.github/workflows/create-release-v2-master-publish-docker.yml @@ -34,8 +34,6 @@ jobs: check-version: needs: [install, build] runs-on: ubuntu-latest - outputs: - release-version: ${{ steps.version.outputs.version }} steps: - name: Checkout uses: actions/checkout@v3 @@ -45,34 +43,36 @@ jobs: run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_ENV - name: Print version - run: echo ${{ steps.version.outputs.version }} + run: echo ${{ env.version }} - uses: mukunku/tag-exists-action@v1.2.0 name: Check tag existence id: check-tag-exists with: - tag: ${{ steps.version.outputs.version }} + tag: ${{ env.version }} - if: ${{ steps.check-tag-exists.outputs.exists == 'false' }} name: Check tag format - id: check-tag-format run: | - if ! [[ "${{ steps.version.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + if ! [[ "$VERSION" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then echo "is-tag-format-correct=false" >> $GITHUB_ENV fi + env: + VERSION: ${{ env.version }} - name: Tag verification - id: check-tag run: | if [[ "${{ steps.check-tag-exists.outputs.exists }}" == "true" ]]; then - echo "Nothing to tag/release, the tag ${{ steps.version.outputs.version }} already exists" + echo "Nothing to tag/release, the tag $VERSION already exists" exit 1 fi - if ! [[ "${{ steps.version.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then - echo "Nothing to tag/release, the tag ${{ steps.version.outputs.version }} is not in correct format X.Y.Z" + if ! [[ "$VERSION" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo "Nothing to tag/release, the tag $VERSION is not in correct format X.Y.Z" exit 1 fi + env: + VERSION: ${{ env.version }} create-release: needs: check-version @@ -95,9 +95,9 @@ jobs: - uses: softprops/action-gh-release@v1 with: - tag_name: ${{ needs.check-version.outputs.release-version }} + tag_name: ${{ env.version }} target_commitish: ${{ github.head_ref || github.ref }} - name: ${{ needs.check-version.outputs.release-version }} + name: ${{ env.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 21c11eafd5a9690ee4f147dfc3f80e4522340ee0 Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Thu, 3 Aug 2023 16:42:01 +0200 Subject: [PATCH 08/12] fix: 2.4.13 --- ...reate-release-v2-master-publish-docker.yml | 28 +++++++++++-------- package.json | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/create-release-v2-master-publish-docker.yml b/.github/workflows/create-release-v2-master-publish-docker.yml index e4cec141..e83168ee 100644 --- a/.github/workflows/create-release-v2-master-publish-docker.yml +++ b/.github/workflows/create-release-v2-master-publish-docker.yml @@ -34,6 +34,8 @@ jobs: check-version: needs: [install, build] runs-on: ubuntu-latest + outputs: + release-version: ${{ steps.version.outputs.version }} steps: - name: Checkout uses: actions/checkout@v3 @@ -43,7 +45,7 @@ jobs: run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_ENV - name: Print version - run: echo ${{ env.version }} + run: echo "Version is ${{ env.version }}" - uses: mukunku/tag-exists-action@v1.2.0 name: Check tag existence @@ -51,28 +53,30 @@ jobs: with: tag: ${{ env.version }} + - name: Print tag existence + run: echo "Tag exists is ${{ steps.check-tag-exists.outputs.exists }}" + - if: ${{ steps.check-tag-exists.outputs.exists == 'false' }} name: Check tag format + id: check-tag-format run: | - if ! [[ "$VERSION" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then - echo "is-tag-format-correct=false" >> $GITHUB_ENV + if ! [[ "${{ env.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Version ${{ env.version }} is not in correct format X.Y.Z" + exit 1 fi - env: - VERSION: ${{ env.version }} - name: Tag verification + id: check-tag run: | if [[ "${{ steps.check-tag-exists.outputs.exists }}" == "true" ]]; then - echo "Nothing to tag/release, the tag $VERSION already exists" + echo "Nothing to tag/release, the tag ${{ env.version }} already exists" exit 1 fi - if ! [[ "$VERSION" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then - echo "Nothing to tag/release, the tag $VERSION is not in correct format X.Y.Z" + if ! [[ "${{ env.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Nothing to tag/release, the tag ${{ env.version }} is not in correct format X.Y.Z" exit 1 fi - env: - VERSION: ${{ env.version }} create-release: needs: check-version @@ -95,9 +99,9 @@ jobs: - uses: softprops/action-gh-release@v1 with: - tag_name: ${{ env.version }} + tag_name: ${{ needs.check-version.outputs.release-version }} target_commitish: ${{ github.head_ref || github.ref }} - name: ${{ env.version }} + name: ${{ needs.check-version.outputs.release-version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 4c969258..0cb44a5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stromae", - "version": "2.4.12", + "version": "2.4.13", "description": "Web application for the management of questionnaires powered by Lunatic", "repository": { "type": "git", From 291f906877a957345f1b174d9c78fedbb81526b3 Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Thu, 3 Aug 2023 16:59:34 +0200 Subject: [PATCH 09/12] fix: testci --- .github/workflows/create-release-v2-master-publish-docker.yml | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release-v2-master-publish-docker.yml b/.github/workflows/create-release-v2-master-publish-docker.yml index e83168ee..e5af4852 100644 --- a/.github/workflows/create-release-v2-master-publish-docker.yml +++ b/.github/workflows/create-release-v2-master-publish-docker.yml @@ -99,9 +99,9 @@ jobs: - uses: softprops/action-gh-release@v1 with: - tag_name: ${{ needs.check-version.outputs.release-version }} + tag_name: ${{ env.version }} target_commitish: ${{ github.head_ref || github.ref }} - name: ${{ needs.check-version.outputs.release-version }} + name: ${{ env.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 0cb44a5a..c792325c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stromae", - "version": "2.4.13", + "version": "2.4.14", "description": "Web application for the management of questionnaires powered by Lunatic", "repository": { "type": "git", From 0db357df77e7ae24f718c04183f47f419e34f19f Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Fri, 4 Aug 2023 09:24:15 +0200 Subject: [PATCH 10/12] fix: test master ci --- ...reate-release-v2-master-publish-docker.yml | 85 +++++++++---------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/.github/workflows/create-release-v2-master-publish-docker.yml b/.github/workflows/create-release-v2-master-publish-docker.yml index e5af4852..812aa258 100644 --- a/.github/workflows/create-release-v2-master-publish-docker.yml +++ b/.github/workflows/create-release-v2-master-publish-docker.yml @@ -1,4 +1,4 @@ -name: Create tag for v2-master with release note +name: Create release & Docker build on: push: @@ -6,33 +6,7 @@ on: - v2-testDevelopCi jobs: - install: - runs-on: ubuntu-latest - steps: - - name: Use Node.js 16 - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: yarn --frozen-lockfile - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Use Node.js 16 - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: yarn - - run: yarn build - - name: Upload build - uses: actions/upload-artifact@v3 - with: - name: build - path: build - check-version: - needs: [install, build] runs-on: ubuntu-latest outputs: release-version: ${{ steps.version.outputs.version }} @@ -42,45 +16,58 @@ jobs: - name: Get version id: version - run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_ENV + run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT - name: Print version - run: echo "Version is ${{ env.version }}" + run: echo ${{ steps.version.outputs.version }} - uses: mukunku/tag-exists-action@v1.2.0 name: Check tag existence id: check-tag-exists with: - tag: ${{ env.version }} - - - name: Print tag existence - run: echo "Tag exists is ${{ steps.check-tag-exists.outputs.exists }}" + tag: ${{ steps.version.outputs.version }} - if: ${{ steps.check-tag-exists.outputs.exists == 'false' }} name: Check tag format id: check-tag-format run: | - if ! [[ "${{ env.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Version ${{ env.version }} is not in correct format X.Y.Z" - exit 1 + if ! [[ "${{ steps.version.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo "is-tag-format-correct=false" >> $GITHUB_OUTPUT fi - name: Tag verification id: check-tag run: | if [[ "${{ steps.check-tag-exists.outputs.exists }}" == "true" ]]; then - echo "Nothing to tag/release, the tag ${{ env.version }} already exists" + echo "Nothing to tag/release, the tag ${{ steps.version.outputs.version }} already exists" exit 1 fi - if ! [[ "${{ env.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Nothing to tag/release, the tag ${{ env.version }} is not in correct format X.Y.Z" + if ! [[ "${{ steps.version.outputs.version }}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo "Nothing to tag/release, the tag ${{ steps.version.outputs.version }} is not in correct format X.Y.Z" exit 1 fi - create-release: + build: needs: check-version runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + - run: yarn + - run: yarn build + - name: Upload build + uses: actions/upload-artifact@v3 + with: + name: build + path: build + + create-release: + needs: [check-version, build] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: @@ -92,16 +79,26 @@ jobs: run: | previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$" | tail -1) if [ -z "$previousTag" ]; then - echo "previousTag=$(git rev-list --max-parents=0 HEAD)" >> $GITHUB_ENV + echo "previousTag=$(git rev-list --max-parents=0 HEAD)" >> $GITHUB_OUTPUT else - echo "previousTag=$previousTag" >> $GITHUB_ENV + echo "previousTag=$previousTag" >> $GITHUB_OUTPUT fi + - name: Create release note + id: changelog + uses: requarks/changelog-action@v1 + with: + fromTag: ${{ github.sha }} + toTag: ${{ steps.previousTag.outputs.previousTag}} + token: ${{ secrets.GITHUB_TOKEN }} + writeToFile: false + - uses: softprops/action-gh-release@v1 with: - tag_name: ${{ env.version }} + tag_name: ${{ needs.check-version.outputs.release-version }} target_commitish: ${{ github.head_ref || github.ref }} - name: ${{ env.version }} + name: ${{ needs.check-version.outputs.release-version }} + body: ${{steps.changelog.outputs.changes}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 40319f1a4f88972dc07fb09ae2a5ec6628dd1bf0 Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Fri, 4 Aug 2023 09:29:48 +0200 Subject: [PATCH 11/12] feat: change branch to v2-master --- .github/workflows/create-release-v2-master-publish-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-v2-master-publish-docker.yml b/.github/workflows/create-release-v2-master-publish-docker.yml index 812aa258..b2250772 100644 --- a/.github/workflows/create-release-v2-master-publish-docker.yml +++ b/.github/workflows/create-release-v2-master-publish-docker.yml @@ -3,7 +3,7 @@ name: Create release & Docker build on: push: branches: - - v2-testDevelopCi + - v2-master jobs: check-version: From c6a5e6730bf5dd48f6203e7c389d509a277fb117 Mon Sep 17 00:00:00 2001 From: MickaelMenet Date: Fri, 4 Aug 2023 09:31:02 +0200 Subject: [PATCH 12/12] fix: change title --- .github/workflows/create-release-v2-master-publish-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-v2-master-publish-docker.yml b/.github/workflows/create-release-v2-master-publish-docker.yml index b2250772..ba96cb3e 100644 --- a/.github/workflows/create-release-v2-master-publish-docker.yml +++ b/.github/workflows/create-release-v2-master-publish-docker.yml @@ -1,4 +1,4 @@ -name: Create release & Docker build +name: Create release & Docker build v2-master on: push: