From fc3116bc03fe5a5fb8fcea26773aba1d95aa28f4 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Wed, 22 May 2024 13:20:58 +0200 Subject: [PATCH 01/29] initial release notes --- .github/release.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..b7e47d22 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,24 @@ +changelog: + exclude: + labels: + - ignore-for-release + categories: + - title: Breaking Changes 🛠 + labels: + - kind/breaking-change + - title: New Features 🎉 + labels: + - kind/feature + - title: Bugfixes 🐛 + labels: + - kind/bug + - title: Other Changes + labels: + - kind/other + - kind/user-story + - title: Dependency Upgrades 📦 + labels: + - kind/dependencies + - title: Uncategorized changes + labels: + - "*" From 99124612c2b8036143dca0faea26a0fa6562d030 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Wed, 22 May 2024 14:30:39 +0200 Subject: [PATCH 02/29] release git action --- .github/actions/release-to-git/action.yml | 36 +++++++++++++++++++++++ .github/workflows/release.yaml | 22 ++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/actions/release-to-git/action.yml create mode 100644 .github/workflows/release.yaml diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml new file mode 100644 index 00000000..b7859e04 --- /dev/null +++ b/.github/actions/release-to-git/action.yml @@ -0,0 +1,36 @@ +name: Create release + +description: Create a release to git if the version has bumped + +inputs: + GITHUB_TOKEN: + description: "GitHub token" + required: true + default: ${{ github.token }} + +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + + - name: Get version + id: get-version + uses: ./.github/actions/get-current-version + + - name: set latest tag + shell: bash + id: set-latest-tag + run: | + - echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_EN + + - name: Create release + shell: bash + if: ${{ latest_tag != steps.get-version.outputs.version }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref_name }} + run: | + gh release create "$tag" \ + --repo="$GITHUB_REPOSITORY" \ + --title="v${steps.get-version.outputs.version}" \ + --generate-notes diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..f127513f --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,22 @@ +name: release + +on: + push: + branches: + - main + - feat/automatic-release-notes + +jobs: + release-to-git: + name: release-to-git + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - name: release + if: (!failure() && !cancelled()) + uses: ./.github/actions/release-to-git + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From e2c01003e0754b412ec173f05b9fcc3281958ff2 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Wed, 22 May 2024 14:32:35 +0200 Subject: [PATCH 03/29] add action/checkout --- .github/workflows/release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f127513f..b3769cdf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,6 +14,9 @@ jobs: id-token: write contents: read steps: + - name: Checkout + uses: actions/checkout@v4 + - name: release if: (!failure() && !cancelled()) uses: ./.github/actions/release-to-git From 1e58af9c1f71eeba68075812bfcbda3dcb6f9fe1 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Wed, 22 May 2024 14:36:40 +0200 Subject: [PATCH 04/29] fix variable names --- .github/actions/release-to-git/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index b7859e04..0f353eee 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -25,9 +25,9 @@ runs: - name: Create release shell: bash - if: ${{ latest_tag != steps.get-version.outputs.version }} + if: ${{ set-latest-tag.latest_tag != steps.get-version.outputs.version }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} tag: ${{ github.ref_name }} run: | gh release create "$tag" \ From ce12dd647c385d75e53032b372e45287b1c4a6ad Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Wed, 22 May 2024 14:39:18 +0200 Subject: [PATCH 05/29] fix variable not getting value --- .github/actions/release-to-git/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 0f353eee..aa0410d0 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -21,7 +21,7 @@ runs: shell: bash id: set-latest-tag run: | - - echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_EN + - echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT - name: Create release shell: bash From 31a8edb2f763b0621533b11ddb65ba03d1a357a8 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Wed, 22 May 2024 14:42:17 +0200 Subject: [PATCH 06/29] fix variable not getting value 2 --- .github/actions/release-to-git/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index aa0410d0..137676c5 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -25,7 +25,7 @@ runs: - name: Create release shell: bash - if: ${{ set-latest-tag.latest_tag != steps.get-version.outputs.version }} + if: ${{ set-latest-tag.outputs.latest_tag != steps.get-version.outputs.version }} env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} tag: ${{ github.ref_name }} From b65af24f42431c9f4db58a8802443821a5a6909e Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Wed, 22 May 2024 14:45:45 +0200 Subject: [PATCH 07/29] fix variable not getting value 3 --- .github/actions/release-to-git/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 137676c5..d28f1b8a 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -25,7 +25,7 @@ runs: - name: Create release shell: bash - if: ${{ set-latest-tag.outputs.latest_tag != steps.get-version.outputs.version }} + if: ${{ steps.set-latest-tag.outputs.latest_tag != steps.get-version.outputs.version }} env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} tag: ${{ github.ref_name }} From 010b8626177e884ce01256e02de8737287801fa2 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Wed, 22 May 2024 16:06:31 +0200 Subject: [PATCH 08/29] output values for testing --- .github/actions/release-to-git/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index d28f1b8a..799f550e 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -17,6 +17,12 @@ runs: id: get-version uses: ./.github/actions/get-current-version + - name: output values + shell: bash + run: | + echo "version=${{ steps.get-version.outputs.version }}" + echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" + - name: set latest tag shell: bash id: set-latest-tag From 18706053536b45403929d2fc984c5efa6c0fbb7e Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 08:18:33 +0200 Subject: [PATCH 09/29] use file directly to get version --- .github/actions/release-to-git/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 799f550e..75c5fece 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -20,7 +20,7 @@ runs: - name: output values shell: bash run: | - echo "version=${{ steps.get-version.outputs.version }}" + echo "version= $(cat version.txt)" echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" - name: set latest tag @@ -31,12 +31,12 @@ runs: - name: Create release shell: bash - if: ${{ steps.set-latest-tag.outputs.latest_tag != steps.get-version.outputs.version }} + if: ${{ !(steps.set-latest-tag.outputs.latest_tag == $(cat version.txt) }} env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} tag: ${{ github.ref_name }} run: | gh release create "$tag" \ --repo="$GITHUB_REPOSITORY" \ - --title="v${steps.get-version.outputs.version}" \ + --title="v${{steps.get-version.outputs.version}}" \ --generate-notes From 2ecccc31590dc9ab0217a63ac7279ea0d82b0e5f Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 08:20:52 +0200 Subject: [PATCH 10/29] fix error --- .github/actions/release-to-git/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 75c5fece..62eb90d4 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -31,7 +31,7 @@ runs: - name: Create release shell: bash - if: ${{ !(steps.set-latest-tag.outputs.latest_tag == $(cat version.txt) }} + if: ${{ !(steps.set-latest-tag.outputs.latest_tag == steps.get-version.outputs.version) }} env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} tag: ${{ github.ref_name }} From b369c75183788e516b178da5e5cfb5625fdf43e9 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 08:28:40 +0200 Subject: [PATCH 11/29] found bug in get-current-version --- .github/actions/get-current-version/action.yml | 5 ++--- .github/actions/release-to-git/action.yml | 14 +++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/actions/get-current-version/action.yml b/.github/actions/get-current-version/action.yml index 2b43b5ac..191d4452 100644 --- a/.github/actions/get-current-version/action.yml +++ b/.github/actions/get-current-version/action.yml @@ -5,7 +5,7 @@ description: "Get the current version from a file and the git short sha" outputs: version: description: "Version" - value: ${{ steps.get-current-version.outputs.version }} + value: ${{ steps.set-current-version.outputs.version }} gitShortSha: description: "Git short sha" value: ${{ steps.set-git-short-sha.outputs.gitShortSha }} @@ -28,9 +28,8 @@ runs: id: set-git-short-sha shell: bash run: echo "gitShortSha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - + - name: Set image tag id: set-image-tag shell: bash run: echo "imageTag=$(cat version.txt)-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 62eb90d4..b30014ba 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -17,18 +17,19 @@ runs: id: get-version uses: ./.github/actions/get-current-version - - name: output values - shell: bash - run: | - echo "version= $(cat version.txt)" - echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" - - name: set latest tag shell: bash + id: set-latest-tag run: | - echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT + - name: output values + shell: bash + run: | + echo "version= $(cat version.txt)" + echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" + - name: Create release shell: bash if: ${{ !(steps.set-latest-tag.outputs.latest_tag == steps.get-version.outputs.version) }} @@ -37,6 +38,5 @@ runs: tag: ${{ github.ref_name }} run: | gh release create "$tag" \ - --repo="$GITHUB_REPOSITORY" \ --title="v${{steps.get-version.outputs.version}}" \ --generate-notes From 9996d07441670d9a30768bea9b1b5a7d5ff01ece Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 09:27:57 +0200 Subject: [PATCH 12/29] small changes --- .github/actions/release-to-git/action.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index b30014ba..69b66411 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -19,24 +19,24 @@ runs: - name: set latest tag shell: bash - id: set-latest-tag run: | - - echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT + - echo "latestTag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT - name: output values shell: bash run: | echo "version= $(cat version.txt)" - echo "latest_tag=$(git tag | sort --version-sort | tail -n1)" + echo "latestTag=$(git tag | sort --version-sort | tail -n1)" - name: Create release shell: bash - if: ${{ !(steps.set-latest-tag.outputs.latest_tag == steps.get-version.outputs.version) }} + if: ${{ !(steps.set-latest-tag.outputs.latestTag == steps.get-version.outputs.version) }} env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} - tag: ${{ github.ref_name }} + TAG: ${{ github.ref_name }} run: | - gh release create "$tag" \ - --title="v${{steps.get-version.outputs.version}}" \ + gh release create "$TAG" + --repo="$GITHUB_REPOSITORY" + --title="v${{steps.get-version.outputs.version}}" --generate-notes From 04e66f5af9b0ab61b7681b261347f3b6077713dd Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 09:43:04 +0200 Subject: [PATCH 13/29] give correct permission --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b3769cdf..5bdc4595 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write - contents: read + contents: write steps: - name: Checkout uses: actions/checkout@v4 From 072597e32cd72573767784459e8fd8131e5627b6 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 09:51:42 +0200 Subject: [PATCH 14/29] fix error in release script --- .github/actions/release-to-git/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 69b66411..6aab6fac 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -21,7 +21,7 @@ runs: shell: bash id: set-latest-tag run: | - - echo "latestTag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT + echo "latestTag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT - name: output values shell: bash @@ -31,7 +31,7 @@ runs: - name: Create release shell: bash - if: ${{ !(steps.set-latest-tag.outputs.latestTag == steps.get-version.outputs.version) }} + if: ${{ !(steps.set-latest-tag.outputs.latestTag == steps.get-version.outputs.version) }} env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} TAG: ${{ github.ref_name }} From ac58400f1c0df18d2f31ba3b4c3480a7290fac54 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 09:54:13 +0200 Subject: [PATCH 15/29] test without repo --- .github/actions/release-to-git/action.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 6aab6fac..a4c40ae7 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -23,12 +23,6 @@ runs: run: | echo "latestTag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT - - name: output values - shell: bash - run: | - echo "version= $(cat version.txt)" - echo "latestTag=$(git tag | sort --version-sort | tail -n1)" - - name: Create release shell: bash if: ${{ !(steps.set-latest-tag.outputs.latestTag == steps.get-version.outputs.version) }} @@ -36,7 +30,4 @@ runs: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} TAG: ${{ github.ref_name }} run: | - gh release create "$TAG" - --repo="$GITHUB_REPOSITORY" - --title="v${{steps.get-version.outputs.version}}" - --generate-notes + gh release create "$TAG" --title="v${{steps.get-version.outputs.version}}" --generate-notes From 03be0ec4e4620ca98216b658fe12b74dcc359ee7 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:00:35 +0200 Subject: [PATCH 16/29] test with version bump --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 1cc5f657..8cfbc905 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.1.0 \ No newline at end of file +1.1.1 \ No newline at end of file From 8ede6157a87ed2972c5c0973dac57fb5ec04c6be Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:02:32 +0200 Subject: [PATCH 17/29] add version to tag --- .github/actions/release-to-git/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index a4c40ae7..b13a9499 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -28,6 +28,6 @@ runs: if: ${{ !(steps.set-latest-tag.outputs.latestTag == steps.get-version.outputs.version) }} env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} - TAG: ${{ github.ref_name }} + TAG: ${{ github.ref_name }}${{ steps.get-version.outputs.version }} run: | gh release create "$TAG" --title="v${{steps.get-version.outputs.version}}" --generate-notes From 40a0bca7090f84bb2f34b6ad254ff1805fc401f6 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:08:33 +0200 Subject: [PATCH 18/29] test without bump --- .github/actions/release-to-git/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index b13a9499..e781081c 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -1,6 +1,6 @@ name: Create release -description: Create a release to git if the version has bumped +description: Create a release to git if the version has been bumped inputs: GITHUB_TOKEN: From be7a02bc112c1e5a8aa5e2c5ffb8e9464e681825 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:12:36 +0200 Subject: [PATCH 19/29] only use version as release tag --- .github/actions/release-to-git/action.yml | 2 +- version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index e781081c..de093d88 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -28,6 +28,6 @@ runs: if: ${{ !(steps.set-latest-tag.outputs.latestTag == steps.get-version.outputs.version) }} env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} - TAG: ${{ github.ref_name }}${{ steps.get-version.outputs.version }} + TAG: ${{ steps.get-version.outputs.version }} run: | gh release create "$TAG" --title="v${{steps.get-version.outputs.version}}" --generate-notes diff --git a/version.txt b/version.txt index 8cfbc905..1cc5f657 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.1.1 \ No newline at end of file +1.1.0 \ No newline at end of file From 556217b62f4418856e02d6ce052f5ca99e39cc76 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:14:48 +0200 Subject: [PATCH 20/29] test without bump --- .github/actions/release-to-git/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index de093d88..1fea4926 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -1,4 +1,4 @@ -name: Create release +name: Create release in github description: Create a release to git if the version has been bumped From 1af4f46dff6cf578dac560f7235d47400eb805dc Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:16:09 +0200 Subject: [PATCH 21/29] output all version tags --- .github/actions/release-to-git/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 1fea4926..19ed0377 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -23,6 +23,11 @@ runs: run: | echo "latestTag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT + - name: output values + run: | + echo "latestTag: ${{ steps.set-latest-tag.outputs.latestTag }}" + echo "version: ${{ steps.get-version.outputs.version }}" + - name: Create release shell: bash if: ${{ !(steps.set-latest-tag.outputs.latestTag == steps.get-version.outputs.version) }} From 42fa41c2a4e37fbadf6c89b027275dec8b0d0bac Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:16:48 +0200 Subject: [PATCH 22/29] add required property --- .github/actions/release-to-git/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 19ed0377..9e5eee2b 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -24,6 +24,7 @@ runs: echo "latestTag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT - name: output values + shell: bash run: | echo "latestTag: ${{ steps.set-latest-tag.outputs.latestTag }}" echo "version: ${{ steps.get-version.outputs.version }}" From f29350b550aa6ad0835a42d2ac2b9fdd80bb7b0b Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:20:32 +0200 Subject: [PATCH 23/29] fetch tags --- .github/actions/release-to-git/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 9e5eee2b..6af25031 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -17,6 +17,10 @@ runs: id: get-version uses: ./.github/actions/get-current-version + - name: fetch tags + shell: bash + run: git fetch --tags + - name: set latest tag shell: bash id: set-latest-tag From d725e19ea7c02d7061f3ac682cda6ab9ca619bb6 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:23:34 +0200 Subject: [PATCH 24/29] release from branch --- .github/actions/release-to-git/action.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 6af25031..163459d4 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -27,12 +27,6 @@ runs: run: | echo "latestTag=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_OUTPUT - - name: output values - shell: bash - run: | - echo "latestTag: ${{ steps.set-latest-tag.outputs.latestTag }}" - echo "version: ${{ steps.get-version.outputs.version }}" - - name: Create release shell: bash if: ${{ !(steps.set-latest-tag.outputs.latestTag == steps.get-version.outputs.version) }} @@ -40,4 +34,4 @@ runs: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} TAG: ${{ steps.get-version.outputs.version }} run: | - gh release create "$TAG" --title="v${{steps.get-version.outputs.version}}" --generate-notes + gh release create "$TAG" --title="v${{steps.get-version.outputs.version}}" --generate-notes --target feat/automatic-release-notes From 9e5563851a728318ccb89f9ab9c415195a945f12 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:24:46 +0200 Subject: [PATCH 25/29] test commit --- .github/actions/release-to-git/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release-to-git/action.yml b/.github/actions/release-to-git/action.yml index 163459d4..5dbefc56 100644 --- a/.github/actions/release-to-git/action.yml +++ b/.github/actions/release-to-git/action.yml @@ -1,6 +1,6 @@ name: Create release in github -description: Create a release to git if the version has been bumped +description: Create a release to git if the version has been bumped in the version.txt file inputs: GITHUB_TOKEN: From 50195d5694370ac88ad73ee6dd6de842b2e9c5af Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:25:00 +0200 Subject: [PATCH 26/29] bump version --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 1cc5f657..8cfbc905 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.1.0 \ No newline at end of file +1.1.1 \ No newline at end of file From c122b36f8f88c00649bc03959b80baa31d8c75f5 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:32:33 +0200 Subject: [PATCH 27/29] Move release action into ci/cd --- .github/workflows/ci-cd.yaml | 18 ++++++++++++++++++ .github/workflows/release.yaml | 25 ------------------------- 2 files changed, 18 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 3f16efc5..edb14e0d 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -108,3 +108,21 @@ jobs: hasAzureChanges: ${{ needs.check-for-changes.outputs.hasAzureChanges }} hasBackendChanges: ${{ needs.check-for-changes.outputs.hasBackendChanges }} hasMigrationChanges: ${{ needs.check-for-changes.outputs.hasMigrationChanges }} + + release-to-git: + name: release to git + runs-on: ubuntu-latest + needs: [check-for-changes, deploy-production] + if: ${{ needs.check-for-changes.outputs.hasBackendChanges == 'true' && !failure() && !cancelled()}} + permissions: + id-token: write + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: release + if: (!failure() && !cancelled()) + uses: ./.github/actions/release-to-git + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 5bdc4595..00000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: release - -on: - push: - branches: - - main - - feat/automatic-release-notes - -jobs: - release-to-git: - name: release-to-git - runs-on: ubuntu-latest - permissions: - id-token: write - contents: write - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: release - if: (!failure() && !cancelled()) - uses: ./.github/actions/release-to-git - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - From b42c482a8ab700f2b06da734a6858710621dd51f Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 10:33:36 +0200 Subject: [PATCH 28/29] don't bump version --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 8cfbc905..1cc5f657 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.1.1 \ No newline at end of file +1.1.0 \ No newline at end of file From cf09ebc316109cd2a59ff33e24c33e6e536f6f82 Mon Sep 17 00:00:00 2001 From: Hammerbeck Date: Thu, 23 May 2024 11:07:17 +0200 Subject: [PATCH 29/29] update readme --- README-infrastructure.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README-infrastructure.md b/README-infrastructure.md index f1aaf00b..d295ce98 100644 --- a/README-infrastructure.md +++ b/README-infrastructure.md @@ -101,4 +101,7 @@ https://pedia.altinn.cloud/altinn-3/ops/release-and-deploy/api-management/ ## After deployment of infrastructure -It's important to check that Microsoft Defender is enabled for all blob storages in the environment. \ No newline at end of file +It's important to check that Microsoft Defender is enabled for all blob storages in the environment. + +## Create release notes +If the version in version.txt is bumped, a new release in github will automaticly be created the next time the production environment is deployed. \ No newline at end of file