From da945848c1e63bdffa8aeae9f205d52d21307a49 Mon Sep 17 00:00:00 2001 From: rti Date: Fri, 4 Oct 2024 16:03:34 +0200 Subject: [PATCH 1/3] fix(github/workflow): checkout git tags and beautify texts (#783) * fix(github/workflow): checkout git tags * chore: beautify workflow texts --- .github/workflows/build_publish_image_release.yml | 2 ++ .github/workflows/create_release.yml | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_publish_image_release.yml b/.github/workflows/build_publish_image_release.yml index a2890fcdc..470b18b6d 100644 --- a/.github/workflows/build_publish_image_release.yml +++ b/.github/workflows/build_publish_image_release.yml @@ -36,6 +36,8 @@ jobs: fi - uses: actions/checkout@v4 + with: + fetch-tags: true - uses: ./.github/actions/setup-environment with: diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index b84c58972..93a2384cf 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -18,7 +18,7 @@ on: - wikibase - All projects (images and deploy) with unreleased changes dry_run: - description: "Only log what will be done, don't do it yet." + description: "Dry run, don't do it yet." type: boolean required: true default: true @@ -33,6 +33,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-tags: true - uses: ./.github/actions/setup-environment with: @@ -44,7 +46,7 @@ jobs: username: wmdetravisbot password: ${{ secrets.WBS_PUBLISH_TOKEN }} - - name: Git tag release + - name: Create release run: | set -e # abort on error set -x # show commands From c94c8cbac8e7f3f825c13f7ef26ec255acb3524b Mon Sep 17 00:00:00 2001 From: rti Date: Fri, 4 Oct 2024 16:17:40 +0200 Subject: [PATCH 2/3] fix(github/workflow): depth 0 to really fetch tags (#784) --- .github/workflows/build_publish_image_release.yml | 6 ++---- .github/workflows/create_release.yml | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_publish_image_release.yml b/.github/workflows/build_publish_image_release.yml index 470b18b6d..de638a4b9 100644 --- a/.github/workflows/build_publish_image_release.yml +++ b/.github/workflows/build_publish_image_release.yml @@ -8,7 +8,7 @@ on: - 'wdqs@*' - 'wdqs-frontend@*' - 'wdqs-proxy@*' - - 'wikibase@*' + - 'wikibase@*' permissions: contents: write @@ -36,8 +36,6 @@ jobs: fi - uses: actions/checkout@v4 - with: - fetch-tags: true - uses: ./.github/actions/setup-environment with: @@ -56,5 +54,5 @@ jobs: git config --global user.name 'wikibase suite github actions bot' git config --global user.email 'wikibase-suite-github-actions-bot@users.noreply.github.com' - + ./nx release publish -p ${{ steps.extract_tag.outputs.imageName }} diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 93a2384cf..b588660a9 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -35,6 +35,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-tags: true + fetch-depth: 0 - uses: ./.github/actions/setup-environment with: From 58a3ece0151e747be16e760e1489702fec8f00d9 Mon Sep 17 00:00:00 2001 From: Loren Johnson Date: Mon, 7 Oct 2024 13:29:33 +0200 Subject: [PATCH 3/3] chore: Add token to release workflow and fix and patch nx command --- .github/workflows/create_release.yml | 9 ++++++++- nx.json | 4 +--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index b588660a9..8c05ddb6a 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -36,6 +36,7 @@ jobs: with: fetch-tags: true fetch-depth: 0 + token: ${{ secrets.GH_WBS_BOT_TOKEN }} - uses: ./.github/actions/setup-environment with: @@ -67,4 +68,10 @@ jobs: PROJECT_ARG="-p ${{ inputs.image_name }}" fi - ./nx release $PROJECT_ARG $DRY_RUN_FLAG + ./nx release $PROJECT_ARG $DRY_RUN_FLAG --skip-publish --verbose + + # Temporary workaround for nx issue: https://github.com/nrwl/nx/issues/22073# + if [ $? -eq 0 ] && [ -z "$DRY_RUN_FLAG" ]; then + git push origin main --tags + fi + diff --git a/nx.json b/nx.json index 4408d021c..82bd4a6e1 100644 --- a/nx.json +++ b/nx.json @@ -21,9 +21,7 @@ "conventionalCommits": true }, "changelog": { - "projectChangelogs": { - "createRelease": "github" - } + "projectChangelogs": true } }, "targetDefaults": {