From b99ca71b878a9d7839fe8b542af3f07a34aaa194 Mon Sep 17 00:00:00 2001 From: Sina <65910646+SinaSeylani@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:05:47 -0600 Subject: [PATCH 1/9] Publish.yml updated --- .github/workflows/create-release.yml | 42 ++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 62fd4f78..a1426358 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -105,24 +105,60 @@ jobs: if: ${{ github.event.inputs.release-type == 'major' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-major }} + echo "Before update:" + cat ios/passage_flutter.podspec + awk -v new_version="$new_version" ' + { + if ($0 ~ /^ s.version/) { + print " s.version = \x27" new_version "\x27" + } else { + print $0 + } + }' ios/passage_flutter.podspec > temp_podspec.podspec + mv temp_podspec.podspec ios/passage_flutter.podspec + echo "After update:" + cat ios/passage_flutter.podspec sed -i "s/version: .*/version: $new_version/" pubspec.yaml - sed -i "s/s.version = '.*'/s.version = '$new_version'/" ios/passage_flutter.podspec echo "Updated to major version $new_version" - name: Update minor version in pubspec.yaml and podspec if: ${{ github.event.inputs.release-type == 'minor' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-minor }} + echo "Before update:" + cat ios/passage_flutter.podspec + awk -v new_version="$new_version" ' + { + if ($0 ~ /^ s.version/) { + print " s.version = \x27" new_version "\x27" + } else { + print $0 + } + }' ios/passage_flutter.podspec > temp_podspec.podspec + mv temp_podspec.podspec ios/passage_flutter.podspec + echo "After update:" + cat ios/passage_flutter.podspec sed -i "s/version: .*/version: $new_version/" pubspec.yaml - sed -i "s/s.version = '.*'/s.version = '$new_version'/" ios/passage_flutter.podspec echo "Updated to minor version $new_version" - name: Update patch version in pubspec.yaml and podspec if: ${{ github.event.inputs.release-type == 'patch' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-patch }} + echo "Before update:" + cat ios/passage_flutter.podspec + awk -v new_version="$new_version" ' + { + if ($0 ~ /^ s.version/) { + print " s.version = \x27" new_version "\x27" + } else { + print $0 + } + }' ios/passage_flutter.podspec > temp_podspec.podspec + mv temp_podspec.podspec ios/passage_flutter.podspec + echo "After update:" + cat ios/passage_flutter.podspec sed -i "s/version: .*/version: $new_version/" pubspec.yaml - sed -i "s/s.version = '.*'/s.version = '$new_version'/" ios/passage_flutter.podspec echo "Updated to patch version $new_version" - name: Update CHANGELOG.md - major release From 0f6e8a77529c8a9f2507b371bfaf38016962a534 Mon Sep 17 00:00:00 2001 From: Sina <65910646+SinaSeylani@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:15:44 -0600 Subject: [PATCH 2/9] Publish.yml updated --- .github/workflows/create-release.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index a1426358..de71dd8b 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -105,8 +105,6 @@ jobs: if: ${{ github.event.inputs.release-type == 'major' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-major }} - echo "Before update:" - cat ios/passage_flutter.podspec awk -v new_version="$new_version" ' { if ($0 ~ /^ s.version/) { @@ -116,8 +114,6 @@ jobs: } }' ios/passage_flutter.podspec > temp_podspec.podspec mv temp_podspec.podspec ios/passage_flutter.podspec - echo "After update:" - cat ios/passage_flutter.podspec sed -i "s/version: .*/version: $new_version/" pubspec.yaml echo "Updated to major version $new_version" @@ -125,8 +121,6 @@ jobs: if: ${{ github.event.inputs.release-type == 'minor' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-minor }} - echo "Before update:" - cat ios/passage_flutter.podspec awk -v new_version="$new_version" ' { if ($0 ~ /^ s.version/) { @@ -136,8 +130,6 @@ jobs: } }' ios/passage_flutter.podspec > temp_podspec.podspec mv temp_podspec.podspec ios/passage_flutter.podspec - echo "After update:" - cat ios/passage_flutter.podspec sed -i "s/version: .*/version: $new_version/" pubspec.yaml echo "Updated to minor version $new_version" @@ -145,8 +137,6 @@ jobs: if: ${{ github.event.inputs.release-type == 'patch' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-patch }} - echo "Before update:" - cat ios/passage_flutter.podspec awk -v new_version="$new_version" ' { if ($0 ~ /^ s.version/) { @@ -156,8 +146,6 @@ jobs: } }' ios/passage_flutter.podspec > temp_podspec.podspec mv temp_podspec.podspec ios/passage_flutter.podspec - echo "After update:" - cat ios/passage_flutter.podspec sed -i "s/version: .*/version: $new_version/" pubspec.yaml echo "Updated to patch version $new_version" From e079adf53c1e77f399d9360b6bcc016547df3fcd Mon Sep 17 00:00:00 2001 From: Sina <65910646+SinaSeylani@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:28:57 -0600 Subject: [PATCH 3/9] create-release updated --- .github/workflows/create-release.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index de71dd8b..500af484 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -149,26 +149,29 @@ jobs: sed -i "s/version: .*/version: $new_version/" pubspec.yaml echo "Updated to patch version $new_version" - - name: Update CHANGELOG.md - major release + - name: Prepend to CHANGELOG.md - major release if: ${{ github.event.inputs.release-type == 'major' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-major }} - echo "## $new_version\n\n- Description of changes\n" >> CHANGELOG.md - echo "Updated CHANGELOG.md with version $new_version" + release_notes="## $new_version\n\n New major release\n\n" + echo -e "$release_notes$(cat CHANGELOG.md)" > CHANGELOG.md + echo "Prepended CHANGELOG.md with version $new_version" - - name: Update CHANGELOG.md - minor release + - name: Prepend to CHANGELOG.md - minor release if: ${{ github.event.inputs.release-type == 'minor' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-minor }} - echo "## $new_version\n\n- Description of changes\n" >> CHANGELOG.md - echo "Updated CHANGELOG.md with version $new_version" + release_notes="## $new_version\n\n New minor release\n\n" + echo -e "$release_notes$(cat CHANGELOG.md)" > CHANGELOG.md + echo "Prepended CHANGELOG.md with version $new_version" - - name: Update CHANGELOG.md - patch release + - name: Prepend to CHANGELOG.md - patch release if: ${{ github.event.inputs.release-type == 'patch' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-patch }} - echo "## $new_version\n\n- Description of changes\n" >> CHANGELOG.md - echo "Updated CHANGELOG.md with version $new_version" + release_notes="## $new_version\n\n New patch release\n\n" + echo -e "$release_notes$(cat CHANGELOG.md)" > CHANGELOG.md + echo "Prepended CHANGELOG.md with version $new_version" - name: Commit major version change uses: stefanzweifel/git-auto-commit-action@v4 From 546d9770dfbb4014a1317c1ec68453a20007fe6a Mon Sep 17 00:00:00 2001 From: Sina <65910646+SinaSeylani@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:34:55 -0600 Subject: [PATCH 4/9] create-release updated --- .github/workflows/create-release.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 500af484..fc70ca65 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -153,24 +153,27 @@ jobs: if: ${{ github.event.inputs.release-type == 'major' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-major }} - release_notes="## $new_version\n\n New major release\n\n" - echo -e "$release_notes$(cat CHANGELOG.md)" > CHANGELOG.md + previous_tag=${{ steps.previoustag.outputs.tag }} + release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) + echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md echo "Prepended CHANGELOG.md with version $new_version" - name: Prepend to CHANGELOG.md - minor release if: ${{ github.event.inputs.release-type == 'minor' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-minor }} - release_notes="## $new_version\n\n New minor release\n\n" - echo -e "$release_notes$(cat CHANGELOG.md)" > CHANGELOG.md + previous_tag=${{ steps.previoustag.outputs.tag }} + release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) + echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md echo "Prepended CHANGELOG.md with version $new_version" - name: Prepend to CHANGELOG.md - patch release if: ${{ github.event.inputs.release-type == 'patch' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-patch }} - release_notes="## $new_version\n\n New patch release\n\n" - echo -e "$release_notes$(cat CHANGELOG.md)" > CHANGELOG.md + previous_tag=${{ steps.previoustag.outputs.tag }} + release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) + echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md echo "Prepended CHANGELOG.md with version $new_version" - name: Commit major version change From 8f140441f607aa690413c1134f03fa1a1bdbc727 Mon Sep 17 00:00:00 2001 From: Sina <65910646+SinaSeylani@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:50:59 -0600 Subject: [PATCH 5/9] create-release updated --- .github/workflows/create-release.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index fc70ca65..25cc790e 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -24,6 +24,7 @@ jobs: branch-major: ${{ steps.branchnames.outputs.major-branch }} branch-minor: ${{ steps.branchnames.outputs.minor-branch }} branch-patch: ${{ steps.branchnames.outputs.patch-branch }} + previous-tag: ${{ steps.getprevioustag.outputs.previous-tag }} steps: - name: Check out code @@ -32,16 +33,17 @@ jobs: fetch-depth: 0 - name: Get Previous Tag - id: previoustag - uses: "WyriHaximus/github-action-get-previous-tag@v1" - with: - fallback: 0.0.0 + id: getprevioustag + run: | + previous_tag=$(git describe --tags $(git rev-list --tags --max-count=1)) + echo "previous_tag=$previous_tag" >> $GITHUB_ENV + echo "::set-output name=previous-tag::$previous_tag" - name: Get Next Versions id: nexttag uses: "WyriHaximus/github-action-next-semvers@v1" with: - version: ${{ steps.previoustag.outputs.tag }} + version: ${{ env.previous_tag }} - name: Build Branch Names id: branchnames @@ -153,7 +155,7 @@ jobs: if: ${{ github.event.inputs.release-type == 'major' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-major }} - previous_tag=${{ steps.previoustag.outputs.tag }} + previous_tag=${{ needs.determine-next-versions.outputs.previous-tag }} release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md echo "Prepended CHANGELOG.md with version $new_version" @@ -162,7 +164,7 @@ jobs: if: ${{ github.event.inputs.release-type == 'minor' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-minor }} - previous_tag=${{ steps.previoustag.outputs.tag }} + previous_tag=${{ needs.determine-next-versions.outputs.previous-tag }} release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md echo "Prepended CHANGELOG.md with version $new_version" @@ -171,7 +173,7 @@ jobs: if: ${{ github.event.inputs.release-type == 'patch' }} run: | new_version=${{ needs.determine-next-versions.outputs.next-patch }} - previous_tag=${{ steps.previoustag.outputs.tag }} + previous_tag=${{ needs.determine-next-versions.outputs.previous-tag }} release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md echo "Prepended CHANGELOG.md with version $new_version" From e84636a797bdaf7e0572129c97f2e0516250e3d8 Mon Sep 17 00:00:00 2001 From: Sina <65910646+SinaSeylani@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:03:28 -0600 Subject: [PATCH 6/9] create-release updated --- .github/workflows/create-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 25cc790e..51ad9d53 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -31,11 +31,13 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + tags: true - name: Get Previous Tag id: getprevioustag run: | previous_tag=$(git describe --tags $(git rev-list --tags --max-count=1)) + echo "Previous Tag: $previous_tag" echo "previous_tag=$previous_tag" >> $GITHUB_ENV echo "::set-output name=previous-tag::$previous_tag" @@ -43,7 +45,7 @@ jobs: id: nexttag uses: "WyriHaximus/github-action-next-semvers@v1" with: - version: ${{ env.previous_tag }} + version: ${{ steps.getprevioustag.outputs.previous-tag }} - name: Build Branch Names id: branchnames From f62c9b3021fce9aad60a7ce96373851090fdab95 Mon Sep 17 00:00:00 2001 From: Sina <65910646+SinaSeylani@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:20:16 -0600 Subject: [PATCH 7/9] create-release updated --- .github/workflows/create-release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 51ad9d53..73259ede 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -33,6 +33,12 @@ jobs: fetch-depth: 0 tags: true + - name: Fetch all tags + run: git fetch --tags + + - name: Fetch all branches and commits + run: git fetch --all + - name: Get Previous Tag id: getprevioustag run: | @@ -41,6 +47,10 @@ jobs: echo "previous_tag=$previous_tag" >> $GITHUB_ENV echo "::set-output name=previous-tag::$previous_tag" + - name: Verify Previous Tag + run: | + git show-ref --tags | grep $previous_tag + - name: Get Next Versions id: nexttag uses: "WyriHaximus/github-action-next-semvers@v1" @@ -159,6 +169,7 @@ jobs: new_version=${{ needs.determine-next-versions.outputs.next-major }} previous_tag=${{ needs.determine-next-versions.outputs.previous-tag }} release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) + echo "Release Notes: $release_notes" echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md echo "Prepended CHANGELOG.md with version $new_version" @@ -168,6 +179,7 @@ jobs: new_version=${{ needs.determine-next-versions.outputs.next-minor }} previous_tag=${{ needs.determine-next-versions.outputs.previous-tag }} release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) + echo "Release Notes: $release_notes" echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md echo "Prepended CHANGELOG.md with version $new_version" @@ -177,6 +189,7 @@ jobs: new_version=${{ needs.determine-next-versions.outputs.next-patch }} previous_tag=${{ needs.determine-next-versions.outputs.previous-tag }} release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) + echo "Release Notes: $release_notes" echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md echo "Prepended CHANGELOG.md with version $new_version" From 4e7d6ccdf86aaeba2cdae34105332fc5148529b9 Mon Sep 17 00:00:00 2001 From: Sina <65910646+SinaSeylani@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:25:23 -0600 Subject: [PATCH 8/9] create-release updated --- .github/workflows/create-release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 73259ede..d45b9b94 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -168,6 +168,9 @@ jobs: run: | new_version=${{ needs.determine-next-versions.outputs.next-major }} previous_tag=${{ needs.determine-next-versions.outputs.previous-tag }} + git fetch --tags + git fetch --all + git log -1 release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) echo "Release Notes: $release_notes" echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md @@ -178,6 +181,9 @@ jobs: run: | new_version=${{ needs.determine-next-versions.outputs.next-minor }} previous_tag=${{ needs.determine-next-versions.outputs.previous-tag }} + git fetch --tags + git fetch --all + git log -1 release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) echo "Release Notes: $release_notes" echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md @@ -188,6 +194,9 @@ jobs: run: | new_version=${{ needs.determine-next-versions.outputs.next-patch }} previous_tag=${{ needs.determine-next-versions.outputs.previous-tag }} + git fetch --tags + git fetch --all + git log -1 release_notes=$(git log --pretty=format:"* %s" $previous_tag..HEAD) echo "Release Notes: $release_notes" echo -e "## $new_version\n\n$release_notes\n\n$(cat CHANGELOG.md)" > CHANGELOG.md From 6518e908667f43d2ef79e5826e1be10293e33f06 Mon Sep 17 00:00:00 2001 From: Sina <65910646+SinaSeylani@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:33:00 -0600 Subject: [PATCH 9/9] create-release updated --- .github/workflows/create-release.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d45b9b94..9effbac5 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -33,12 +33,6 @@ jobs: fetch-depth: 0 tags: true - - name: Fetch all tags - run: git fetch --tags - - - name: Fetch all branches and commits - run: git fetch --all - - name: Get Previous Tag id: getprevioustag run: | @@ -47,10 +41,6 @@ jobs: echo "previous_tag=$previous_tag" >> $GITHUB_ENV echo "::set-output name=previous-tag::$previous_tag" - - name: Verify Previous Tag - run: | - git show-ref --tags | grep $previous_tag - - name: Get Next Versions id: nexttag uses: "WyriHaximus/github-action-next-semvers@v1"