diff --git a/.github/actions/yarn-version/action.yml b/.github/actions/yarn-version/action.yml index 7d5e2b0..023c5fc 100644 --- a/.github/actions/yarn-version/action.yml +++ b/.github/actions/yarn-version/action.yml @@ -6,15 +6,11 @@ inputs: repository_dir: description: 'Directory of repository to update' required: true - skip_tag: - description: 'Skip git tag' - required: false - default: "false" runs: using: composite steps: - - name: Update yarn version and tag ${{ env.RELEASE }} + - name: Update yarn version and tag shell: bash working-directory: ${{ inputs.repository_dir }} env: @@ -24,7 +20,4 @@ runs: yarn config set version-git-tag false yarn version --new-version $RELEASE git commit --allow-empty -am "Update version to $RELEASE" - if [ "$SKIP_TAG" == "false" ]; then - echo "Tagging yarn version $RELEASE" - git tag $RELEASE - fi + git tag --force $RELEASE_TAG diff --git a/.github/workflows/pass-complete-release.yml b/.github/workflows/pass-complete-release.yml index e01aed0..0b27e89 100644 --- a/.github/workflows/pass-complete-release.yml +++ b/.github/workflows/pass-complete-release.yml @@ -17,6 +17,7 @@ jobs: env: RELEASE: ${{ inputs.releaseversion }} NEXT: ${{ inputs.nextversion }} + NEXT_TAG: ${{ inputs.nextversion }}-init steps: - name: Checkout main uses: actions/checkout@v4 @@ -119,9 +120,9 @@ jobs: - name: Push the Release commits and tags ~ Java Repositories if: ${{ ! env.ALL_JAVA_REPOS_TAG_EXISTS }} run: | - (cd main && git push origin && git push origin --force --tags) - (cd combined/pass-core && git push origin && git push origin --force --tags) - (cd combined/pass-support && git push origin && git push origin --force --tags) + (cd main && git push --atomic origin --force $RELEASE) + (cd combined/pass-core && git push --atomic origin --force $RELEASE) + (cd combined/pass-support && git push --atomic origin --force $RELEASE) - name: Create GitHub main release ~ Java Repositories if: ${{ ! env.ALL_JAVA_REPOS_TAG_EXISTS }} @@ -142,6 +143,7 @@ jobs: repository_dir: combined/pass-ui env: RELEASE: ${{ env.RELEASE }} + RELEASE_TAG: ${{ env.RELEASE }} - name: Build Release pass-ui if: ${{ ! env.PASS_UI_TAG_EXISTS }} @@ -156,7 +158,7 @@ jobs: - name: Push the Release commits and tags ~ pass-ui if: ${{ ! env.PASS_UI_TAG_EXISTS }} - run: cd combined/pass-ui && git push origin && git push origin --tags + run: cd combined/pass-ui && git push --atomic origin --force $RELEASE - name: Create GitHub main release ~ pass-ui if: ${{ ! env.PASS_UI_TAG_EXISTS }} @@ -171,10 +173,11 @@ jobs: repository_dir: combined/pass-acceptance-testing env: RELEASE: ${{ env.RELEASE }} + RELEASE_TAG: ${{ env.RELEASE }} - name: Push the Release commits and tags ~ pass-acceptance-testing if: ${{ ! env.PASS_ACCPT_TEST_TAG_EXISTS }} - run: cd combined/pass-acceptance-testing && git push origin && git push origin --tags + run: cd combined/pass-acceptance-testing && git push --atomic origin --force $RELEASE - name: Create GitHub main release ~ pass-acceptance-testing if: ${{ ! env.PASS_ACCPT_TEST_TAG_EXISTS }} @@ -188,7 +191,7 @@ jobs: cd combined/pass-docker sed -i "/^PASS_VERSION/s/.*/PASS_VERSION=$RELEASE/" .env git commit --allow-empty -am "Update version to $RELEASE" - git tag $RELEASE + git tag --force $RELEASE - name: Build Release pass-docker images if: ${{ ! env.PASS_DOCKER_TAG_EXISTS }} @@ -203,7 +206,7 @@ jobs: - name: Push the Release commits and tags ~ pass-docker if: ${{ ! env.PASS_DOCKER_TAG_EXISTS }} - run: cd combined/pass-docker && git push origin && git push origin --tags + run: cd combined/pass-docker && git push --atomic origin --force $RELEASE - name: Create GitHub main release ~ pass-docker if: ${{ ! env.PASS_DOCKER_TAG_EXISTS }} @@ -213,10 +216,10 @@ jobs: - name: Set Snapshot/commit ~ Java Repositories run: | - (cd main && mvn versions:set -B -ntp -DallowSnapshots=true -DnewVersion=$NEXT && git commit --allow-empty -am "Update version to $NEXT") + (cd main && mvn versions:set -B -ntp -DallowSnapshots=true -DnewVersion=$NEXT && git commit --allow-empty -am "Update version to $NEXT" && git tag --force $NEXT_TAG) (cd combined && mvn versions:set -B -ntp -DallowSnapshots=true -DnewVersion=$NEXT) - (cd combined/pass-core && git commit --allow-empty -am "Update version to $NEXT") - (cd combined/pass-support && git commit --allow-empty -am "Update version to $NEXT") + (cd combined/pass-core && git commit --allow-empty -am "Update version to $NEXT" && git tag --force $NEXT_TAG) + (cd combined/pass-support && git commit --allow-empty -am "Update version to $NEXT" && git tag --force $NEXT_TAG) - name: Release Snapshot Java modules working-directory: combined @@ -238,17 +241,17 @@ jobs: - name: Push the Snapshot commits ~ Java Repositories run: | - (cd main && git push origin) - (cd combined/pass-core && git push origin) - (cd combined/pass-support && git push origin) + (cd main && git push --atomic origin --force $NEXT_TAG) + (cd combined/pass-core && git push --atomic origin --force $NEXT_TAG) + (cd combined/pass-support && git push --atomic origin --force $NEXT_TAG) - name: Set Snapshot/commit ~ pass-ui uses: ./main/.github/actions/yarn-version with: repository_dir: combined/pass-ui - skip_tag: "true" env: RELEASE: ${{ env.NEXT }} + RELEASE_TAG: ${{ env.NEXT_TAG }} - name: Build Snapshot pass-ui uses: ./main/.github/actions/yarn-build @@ -261,24 +264,25 @@ jobs: run: docker push ghcr.io/eclipse-pass/pass-ui:$NEXT - name: Push the Snapshot commits ~ pass-ui - run: cd combined/pass-ui && git push origin + run: cd combined/pass-ui && git push --atomic origin --force $NEXT_TAG - name: Set Snapshot/commit ~ pass-acceptance-testing uses: ./main/.github/actions/yarn-version with: repository_dir: combined/pass-acceptance-testing - skip_tag: "true" env: RELEASE: ${{ env.NEXT }} + RELEASE_TAG: ${{ env.NEXT_TAG }} - name: Push the Snapshot commits ~ pass-acceptance-testing - run: cd combined/pass-acceptance-testing && git push origin + run: cd combined/pass-acceptance-testing && git push --atomic origin --force $NEXT_TAG - name: Set Snapshot/commit ~ pass-docker run: | cd combined/pass-docker sed -i "/^PASS_VERSION/s/.*/PASS_VERSION=$NEXT/" .env git commit --allow-empty -am "Update version to $NEXT" + git tag --force $NEXT_TAG - name: Build Snapshot pass-docker images working-directory: combined/pass-docker @@ -290,4 +294,4 @@ jobs: docker push ghcr.io/eclipse-pass/idp:$NEXT - name: Push the Snapshot commits ~ pass-docker - run: cd combined/pass-docker && git push origin + run: cd combined/pass-docker && git push --atomic origin --force $NEXT_TAG