From 5fb5cb95e07f29148b68c61ca22cc758d730b5db Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:40:57 +1100 Subject: [PATCH 01/19] Introduce force release CI to automate releases after CI checks, preventing re-checking on release --- .github/workflows/force-release.yaml | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/force-release.yaml diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml new file mode 100644 index 0000000000..4f9d892fb4 --- /dev/null +++ b/.github/workflows/force-release.yaml @@ -0,0 +1,59 @@ +name: Force release libsbp +on: + workflow_dispatch: + inputs: + major: + description: 'Semver major label' + required: true + minor: + description: 'Semver minor label' + required: true + patch: + description: 'Semver patch label' + required: true +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Update C version + run: | + sed -i "s/define SBP_VERSION_MAJOR .*/define SBP_VERSION_MAJOR $MAJOR/" c/include/libsbp/version.h + sed -i "s/define SBP_VERSION_MINOR .*/define SBP_VERSION_MINOR $MINOR/" c/include/libsbp/version.h + sed -i "s/define SBP_VERSION_PATCH .*/define SBP_VERSION_PATCH $PATCH/" c/include/libsbp/version.h + sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH\"/" c/include/libsbp/version.h + - name: Update Haskell version + run: | + sed -i "s/version: .*/version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal + - name: Update Javascript version + run: | + echo "$MAJOR.$MINOR.$PATCH" > javascript/sbp/RELEASE-VERSION + sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package.json + sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package-lock.json + - name: Update Python version + run: | + echo "$MAJOR.$MINOR.$PATCH" > python/sbp/RELEASE-VERSION + - name: Update Rust version + run: | + sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml + sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml + - name: Update PDF + run: echo "TODO" + - name: Commit changes + run: | + git checkout -b force-release-v$MAJOR.$MINOR.$PATCH + git add . + git status + git commit -m "force release v$MAJOR.$MINOR.$PATCH" + git push --set-upstream origin force-release-v$MAJOR.$MINOR.$PATCH + - name: Create PR + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ env.GITHUB_TOKEN }} + commit-message: "chore: force release v$MAJOR.$MINOR.$PATCH" + title: "chore: force release v$MAJOR.$MINOR.$PATCH" + body: "chore: force release v$MAJOR.$MINOR.$PATCH" + branch: "force-release-v$MAJOR.$MINOR.$PATCH" + base: "master" + branch-suffix: "force-release-v$MAJOR.$MINOR.$PATCH" + delete-branch: true \ No newline at end of file From 11f217e2879359b41130c2f40a79ffe64dae500a Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:46:46 +1100 Subject: [PATCH 02/19] Needs to trigger once on push to register as workflow --- .github/workflows/force-release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 4f9d892fb4..3e1855cb52 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -1,5 +1,6 @@ name: Force release libsbp on: + push: workflow_dispatch: inputs: major: From 16104c26a3082bdb0585882acfc00893a740d13e Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:47:09 +1100 Subject: [PATCH 03/19] Revert push trigger --- .github/workflows/force-release.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 3e1855cb52..4f9d892fb4 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -1,6 +1,5 @@ name: Force release libsbp on: - push: workflow_dispatch: inputs: major: From f2d007ff53a21b786d62400cdb0a5067fc96f982 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:52:27 +1100 Subject: [PATCH 04/19] Echo major minor patch --- .github/workflows/force-release.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 4f9d892fb4..ce10067c56 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -1,5 +1,6 @@ name: Force release libsbp on: + pull_request: workflow_dispatch: inputs: major: @@ -15,6 +16,12 @@ jobs: release: runs-on: ubuntu-latest steps: + - name: Echo inputs + run: | + echo "major: ${{ github.event.inputs.major }}" + echo "minor: ${{ github.event.inputs.minor }}" + echo "patch: ${{ github.event.inputs.patch }}" + echo "v$MAJOR.$MINOR.$PATCH" - uses: actions/checkout@v2 - name: Update C version run: | @@ -41,11 +48,11 @@ jobs: run: echo "TODO" - name: Commit changes run: | - git checkout -b force-release-v$MAJOR.$MINOR.$PATCH + git checkout -b "force-release-v$MAJOR.$MINOR.$PATCH" git add . git status git commit -m "force release v$MAJOR.$MINOR.$PATCH" - git push --set-upstream origin force-release-v$MAJOR.$MINOR.$PATCH + git push --set-upstream origin "force-release-v$MAJOR.$MINOR.$PATCH" - name: Create PR uses: peter-evans/create-pull-request@v3 with: From f056db7383b1df1a2fd882f0b395b7d048ea94de Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:53:26 +1100 Subject: [PATCH 05/19] Pass inputs as env variable --- .github/workflows/force-release.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index ce10067c56..0f061d29c7 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -1,6 +1,5 @@ name: Force release libsbp on: - pull_request: workflow_dispatch: inputs: major: @@ -12,6 +11,10 @@ on: patch: description: 'Semver patch label' required: true +env: + MAJOR: ${{ github.event.inputs.major }} + MINOR: ${{ github.event.inputs.minor }} + PATCH: ${{ github.event.inputs.patch }} jobs: release: runs-on: ubuntu-latest From ffe73744732111eaa04667855d668895f140448e Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:55:48 +1100 Subject: [PATCH 06/19] Pass secrets --- .github/workflows/force-release.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 0f061d29c7..a539c52ff6 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -51,19 +51,20 @@ jobs: run: echo "TODO" - name: Commit changes run: | - git checkout -b "force-release-v$MAJOR.$MINOR.$PATCH" - git add . +# git checkout -b "force-release-v$MAJOR.$MINOR.$PATCH" +# git add . git status - git commit -m "force release v$MAJOR.$MINOR.$PATCH" - git push --set-upstream origin "force-release-v$MAJOR.$MINOR.$PATCH" +# git commit -m "force release v$MAJOR.$MINOR.$PATCH" +# git push --set-upstream origin "force-release-v$MAJOR.$MINOR.$PATCH" - name: Create PR uses: peter-evans/create-pull-request@v3 with: - token: ${{ env.GITHUB_TOKEN }} + token: ${{ secrets.GH_TOKEN }} commit-message: "chore: force release v$MAJOR.$MINOR.$PATCH" title: "chore: force release v$MAJOR.$MINOR.$PATCH" body: "chore: force release v$MAJOR.$MINOR.$PATCH" branch: "force-release-v$MAJOR.$MINOR.$PATCH" base: "master" branch-suffix: "force-release-v$MAJOR.$MINOR.$PATCH" - delete-branch: true \ No newline at end of file + delete-branch: true + add-paths: * \ No newline at end of file From a01798835c352f7c302940e6a75a9920427614f2 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:56:50 +1100 Subject: [PATCH 07/19] Commenting --- .github/workflows/force-release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index a539c52ff6..6894698424 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -51,11 +51,11 @@ jobs: run: echo "TODO" - name: Commit changes run: | -# git checkout -b "force-release-v$MAJOR.$MINOR.$PATCH" -# git add . + # git checkout -b "force-release-v$MAJOR.$MINOR.$PATCH" + # git add . git status -# git commit -m "force release v$MAJOR.$MINOR.$PATCH" -# git push --set-upstream origin "force-release-v$MAJOR.$MINOR.$PATCH" + # git commit -m "force release v$MAJOR.$MINOR.$PATCH" + # git push --set-upstream origin "force-release-v$MAJOR.$MINOR.$PATCH" - name: Create PR uses: peter-evans/create-pull-request@v3 with: From 62bd92816981dab25cb72cdfbed47eddb9bf6387 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:57:57 +1100 Subject: [PATCH 08/19] Debug --- .github/workflows/force-release.yaml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 6894698424..f770400013 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -47,15 +47,17 @@ jobs: run: | sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml - - name: Update PDF - run: echo "TODO" - - name: Commit changes - run: | - # git checkout -b "force-release-v$MAJOR.$MINOR.$PATCH" - # git add . - git status - # git commit -m "force release v$MAJOR.$MINOR.$PATCH" - # git push --set-upstream origin "force-release-v$MAJOR.$MINOR.$PATCH" + - name: Debug + run: git status +# - name: Update PDF +# run: echo "TODO" +# - name: Commit changes +# run: | +# git checkout -b "force-release-v$MAJOR.$MINOR.$PATCH" +# git add . +# git status +# git commit -m "force release v$MAJOR.$MINOR.$PATCH" +# git push --set-upstream origin "force-release-v$MAJOR.$MINOR.$PATCH" - name: Create PR uses: peter-evans/create-pull-request@v3 with: From e676baf3a13d64e695cc58ee738ee147dec18863 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:58:15 +1100 Subject: [PATCH 09/19] Debug --- .github/workflows/force-release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index f770400013..2db14c0177 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -11,6 +11,7 @@ on: patch: description: 'Semver patch label' required: true + pull_request: env: MAJOR: ${{ github.event.inputs.major }} MINOR: ${{ github.event.inputs.minor }} From 19800bc4ad8fb255b06579d5940d571fe6a5c0cd Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 08:58:53 +1100 Subject: [PATCH 10/19] Debug --- .github/workflows/force-release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 2db14c0177..11555486a1 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -70,4 +70,5 @@ jobs: base: "master" branch-suffix: "force-release-v$MAJOR.$MINOR.$PATCH" delete-branch: true - add-paths: * \ No newline at end of file + add-paths: | + * \ No newline at end of file From ae97e36e98a1e7edbd76a9d0e6482f0e002738e3 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 09:03:27 +1100 Subject: [PATCH 11/19] pass templated semver string --- .github/workflows/force-release.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 11555486a1..34e9c4d6b2 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -11,11 +11,11 @@ on: patch: description: 'Semver patch label' required: true - pull_request: env: MAJOR: ${{ github.event.inputs.major }} MINOR: ${{ github.event.inputs.minor }} PATCH: ${{ github.event.inputs.patch }} + SEMVER: $MAJOR.$MINOR.$PATCH jobs: release: runs-on: ubuntu-latest @@ -32,22 +32,22 @@ jobs: sed -i "s/define SBP_VERSION_MAJOR .*/define SBP_VERSION_MAJOR $MAJOR/" c/include/libsbp/version.h sed -i "s/define SBP_VERSION_MINOR .*/define SBP_VERSION_MINOR $MINOR/" c/include/libsbp/version.h sed -i "s/define SBP_VERSION_PATCH .*/define SBP_VERSION_PATCH $PATCH/" c/include/libsbp/version.h - sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH\"/" c/include/libsbp/version.h + sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$SEMVER\"/" c/include/libsbp/version.h - name: Update Haskell version run: | sed -i "s/version: .*/version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal - name: Update Javascript version run: | echo "$MAJOR.$MINOR.$PATCH" > javascript/sbp/RELEASE-VERSION - sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package.json - sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package-lock.json + sed -i "s/\"version\": \".*\"/\"version\": \"$SEMVER\"/" package.json + sed -i "s/\"version\": \".*\"/\"version\": \"$SEMVER\"/" package-lock.json - name: Update Python version run: | echo "$MAJOR.$MINOR.$PATCH" > python/sbp/RELEASE-VERSION - name: Update Rust version run: | - sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml - sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml + sed -i "s/version = \".*\"/version = \"$SEMVER\"/" rust/sbp/Cargo.toml + sed -i "s/version = \".*\"/version = \"$SEMVER-unreleased\"/" rust/sbp2json/Cargo.toml - name: Debug run: git status # - name: Update PDF @@ -63,12 +63,12 @@ jobs: uses: peter-evans/create-pull-request@v3 with: token: ${{ secrets.GH_TOKEN }} - commit-message: "chore: force release v$MAJOR.$MINOR.$PATCH" - title: "chore: force release v$MAJOR.$MINOR.$PATCH" - body: "chore: force release v$MAJOR.$MINOR.$PATCH" - branch: "force-release-v$MAJOR.$MINOR.$PATCH" + commit-message: "chore: force release ${{ env.SEMVER }}" + title: "chore: force release ${{ env.SEMVER }}" + body: "chore: force release ${{ env.SEMVER }}" + branch: "force-release-${{ env.SEMVER }}" base: "master" - branch-suffix: "force-release-v$MAJOR.$MINOR.$PATCH" + branch-suffix: "force-release-${{ env.SEMVER }}" delete-branch: true add-paths: | * \ No newline at end of file From 63a750706bdc22c399447803061d4d282563f40d Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 09:05:14 +1100 Subject: [PATCH 12/19] Debug --- .github/workflows/force-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 34e9c4d6b2..59c590d2ae 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -15,7 +15,7 @@ env: MAJOR: ${{ github.event.inputs.major }} MINOR: ${{ github.event.inputs.minor }} PATCH: ${{ github.event.inputs.patch }} - SEMVER: $MAJOR.$MINOR.$PATCH + SEMVER: "$MAJOR.$MINOR.$PATCH" jobs: release: runs-on: ubuntu-latest From 4e66997e1e1ee9dd0ec321b44ef9a48b7ca39191 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 09:06:31 +1100 Subject: [PATCH 13/19] semver --- .github/workflows/force-release.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 59c590d2ae..d0e344a1c2 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -15,7 +15,7 @@ env: MAJOR: ${{ github.event.inputs.major }} MINOR: ${{ github.event.inputs.minor }} PATCH: ${{ github.event.inputs.patch }} - SEMVER: "$MAJOR.$MINOR.$PATCH" + SEMVER: "${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" jobs: release: runs-on: ubuntu-latest @@ -70,5 +70,7 @@ jobs: base: "master" branch-suffix: "force-release-${{ env.SEMVER }}" delete-branch: true + author: swiftnav-travis + add-paths: | * \ No newline at end of file From 80fad2aea2b6c4b65cab3aa7b96c52ff5782297a Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 09:07:12 +1100 Subject: [PATCH 14/19] semver --- .github/workflows/force-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index d0e344a1c2..3b37142508 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -15,7 +15,7 @@ env: MAJOR: ${{ github.event.inputs.major }} MINOR: ${{ github.event.inputs.minor }} PATCH: ${{ github.event.inputs.patch }} - SEMVER: "${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" + SEMVER: "${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}" jobs: release: runs-on: ubuntu-latest From 584a6ad63ebe815401b768f6bde137b05f7723d3 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 09:10:09 +1100 Subject: [PATCH 15/19] semver --- .github/workflows/force-release.yaml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 3b37142508..dcebb8e7c5 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -15,7 +15,6 @@ env: MAJOR: ${{ github.event.inputs.major }} MINOR: ${{ github.event.inputs.minor }} PATCH: ${{ github.event.inputs.patch }} - SEMVER: "${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}" jobs: release: runs-on: ubuntu-latest @@ -32,22 +31,22 @@ jobs: sed -i "s/define SBP_VERSION_MAJOR .*/define SBP_VERSION_MAJOR $MAJOR/" c/include/libsbp/version.h sed -i "s/define SBP_VERSION_MINOR .*/define SBP_VERSION_MINOR $MINOR/" c/include/libsbp/version.h sed -i "s/define SBP_VERSION_PATCH .*/define SBP_VERSION_PATCH $PATCH/" c/include/libsbp/version.h - sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$SEMVER\"/" c/include/libsbp/version.h + sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH\"/" c/include/libsbp/version.h - name: Update Haskell version run: | sed -i "s/version: .*/version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal - name: Update Javascript version run: | echo "$MAJOR.$MINOR.$PATCH" > javascript/sbp/RELEASE-VERSION - sed -i "s/\"version\": \".*\"/\"version\": \"$SEMVER\"/" package.json - sed -i "s/\"version\": \".*\"/\"version\": \"$SEMVER\"/" package-lock.json + sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package.json + sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package-lock.json - name: Update Python version run: | echo "$MAJOR.$MINOR.$PATCH" > python/sbp/RELEASE-VERSION - name: Update Rust version run: | - sed -i "s/version = \".*\"/version = \"$SEMVER\"/" rust/sbp/Cargo.toml - sed -i "s/version = \".*\"/version = \"$SEMVER-unreleased\"/" rust/sbp2json/Cargo.toml + sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml + sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml - name: Debug run: git status # - name: Update PDF @@ -63,14 +62,11 @@ jobs: uses: peter-evans/create-pull-request@v3 with: token: ${{ secrets.GH_TOKEN }} - commit-message: "chore: force release ${{ env.SEMVER }}" - title: "chore: force release ${{ env.SEMVER }}" - body: "chore: force release ${{ env.SEMVER }}" - branch: "force-release-${{ env.SEMVER }}" + commit-message: "chore: force release v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" + title: "chore: force release v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" + body: "automated release of v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" + branch: "force-release-v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" base: "master" - branch-suffix: "force-release-${{ env.SEMVER }}" delete-branch: true - author: swiftnav-travis - add-paths: | * \ No newline at end of file From f1a6f67ab484e375f5ebca09f34b39a4d3d4a71e Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 09:31:05 +1100 Subject: [PATCH 16/19] Fix up sed replaces --- .github/workflows/force-release.yaml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index dcebb8e7c5..bcef49a481 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -28,25 +28,25 @@ jobs: - uses: actions/checkout@v2 - name: Update C version run: | - sed -i "s/define SBP_VERSION_MAJOR .*/define SBP_VERSION_MAJOR $MAJOR/" c/include/libsbp/version.h - sed -i "s/define SBP_VERSION_MINOR .*/define SBP_VERSION_MINOR $MINOR/" c/include/libsbp/version.h - sed -i "s/define SBP_VERSION_PATCH .*/define SBP_VERSION_PATCH $PATCH/" c/include/libsbp/version.h + sed -i "s/define SBP_MAJOR_VERSION .*/define SBP_MAJOR_VERSION $MAJOR/" c/include/libsbp/version.h + sed -i "s/define SBP_MINOR_VERSION .*/define SBP_MINOR_VERSION $MINOR/" c/include/libsbp/version.h + sed -i "s/define SBP_PATCH_VERSION .*/define SBP_PATCH_VERSION $PATCH/" c/include/libsbp/version.h sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH\"/" c/include/libsbp/version.h - name: Update Haskell version run: | - sed -i "s/version: .*/version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal + sed -i "0,/^version: .*/s//version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal - name: Update Javascript version run: | - echo "$MAJOR.$MINOR.$PATCH" > javascript/sbp/RELEASE-VERSION - sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package.json - sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package-lock.json + echo -n "$MAJOR.$MINOR.$PATCH" > javascript/sbp/RELEASE-VERSION + jq --arg v "$MAJOR.$MINOR.$PATCH" '.version = $v' package.json > tmp1.$$.json && mv tmp1.$$.json package.json + jq --arg v "$MAJOR.$MINOR.$PATCH" '.version = $v | .packages[""].version = $v' package-lock.json > tmp2.$$.json && mv tmp2.$$.json package-lock.json - name: Update Python version run: | - echo "$MAJOR.$MINOR.$PATCH" > python/sbp/RELEASE-VERSION + echo -n "$MAJOR.$MINOR.$PATCH" > python/sbp/RELEASE-VERSION - name: Update Rust version run: | - sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml - sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml + sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml + sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml - name: Debug run: git status # - name: Update PDF @@ -67,6 +67,7 @@ jobs: body: "automated release of v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" branch: "force-release-v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" base: "master" + author: swiftnav-travis delete-branch: true add-paths: | * \ No newline at end of file From a84577a26b7aec61e6375901446e94ae5994daef Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 09:52:11 +1100 Subject: [PATCH 17/19] add author --- .github/workflows/force-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index bcef49a481..fe7774e6bc 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -67,7 +67,7 @@ jobs: body: "automated release of v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" branch: "force-release-v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" base: "master" - author: swiftnav-travis + author: "swiftnav-travis " delete-branch: true add-paths: | * \ No newline at end of file From be6aee324a0d05ef17a1ca5f48d7f2a5aa99e53c Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 10:23:13 +1100 Subject: [PATCH 18/19] -alpha add prep next release option --- .github/workflows/force-release.yaml | 47 ++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index fe7774e6bc..76cfab336d 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -4,17 +4,26 @@ on: inputs: major: description: 'Semver major label' + type: number required: true minor: description: 'Semver minor label' + type: number required: true patch: description: 'Semver patch label' + type: number required: true + prep-next-release: + description: 'Prep next release, this should only be triggered after a release has been made' + type: boolean + required: false + default: false env: MAJOR: ${{ github.event.inputs.major }} MINOR: ${{ github.event.inputs.minor }} PATCH: ${{ github.event.inputs.patch }} + PREP_NEXT: ${{ github.event.inputs.prep-next-release }} jobs: release: runs-on: ubuntu-latest @@ -31,24 +40,44 @@ jobs: sed -i "s/define SBP_MAJOR_VERSION .*/define SBP_MAJOR_VERSION $MAJOR/" c/include/libsbp/version.h sed -i "s/define SBP_MINOR_VERSION .*/define SBP_MINOR_VERSION $MINOR/" c/include/libsbp/version.h sed -i "s/define SBP_PATCH_VERSION .*/define SBP_PATCH_VERSION $PATCH/" c/include/libsbp/version.h - sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH\"/" c/include/libsbp/version.h + if [ $PREP_NEXT ] then + sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH-alpha\"/" c/include/libsbp/version.h + else + sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH\"/" c/include/libsbp/version.h + fi - name: Update Haskell version run: | - sed -i "0,/^version: .*/s//version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal + if [ $PREP_NEXT ] then + sed -i "0,/^version: .*/s//version: $MAJOR.$MINOR.$PATCH-alpha/" haskell/sbp.cabal + else + sed -i "0,/^version: .*/s//version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal + fi - name: Update Javascript version run: | - echo -n "$MAJOR.$MINOR.$PATCH" > javascript/sbp/RELEASE-VERSION - jq --arg v "$MAJOR.$MINOR.$PATCH" '.version = $v' package.json > tmp1.$$.json && mv tmp1.$$.json package.json - jq --arg v "$MAJOR.$MINOR.$PATCH" '.version = $v | .packages[""].version = $v' package-lock.json > tmp2.$$.json && mv tmp2.$$.json package-lock.json + if [ $PREP_NEXT ] then + echo -n "$MAJOR.$MINOR.$PATCH-alpha" > javascript/sbp/RELEASE-VERSION + jq --arg v "$MAJOR.$MINOR.$PATCH-alpha" '.version = $v' package.json > tmp1.$$.json && mv tmp1.$$.json package.json + jq --arg v "$MAJOR.$MINOR.$PATCH-alpha" '.version = $v | .packages[""].version = $v' package-lock.json > tmp2.$$.json && mv tmp2.$$.json package-lock.json + else + echo -n "$MAJOR.$MINOR.$PATCH" > javascript/sbp/RELEASE-VERSION + jq --arg v "$MAJOR.$MINOR.$PATCH" '.version = $v' package.json > tmp1.$$.json && mv tmp1.$$.json package.json + jq --arg v "$MAJOR.$MINOR.$PATCH" '.version = $v | .packages[""].version = $v' package-lock.json > tmp2.$$.json && mv tmp2.$$.json package-lock.json + fi - name: Update Python version run: | echo -n "$MAJOR.$MINOR.$PATCH" > python/sbp/RELEASE-VERSION - name: Update Rust version run: | - sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml - sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml - - name: Debug - run: git status + if [ $PREP_NEXT ] then + sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml + sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml + else + sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH-alpha\"/" rust/sbp/Cargo.toml + sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH-alpha\"/" rust/sbp2json/Cargo.toml + fi + - name: Update CHANGELOG + if: ${{ github.event.inputs.prep-next-release }} + run: echo "test123" # - name: Update PDF # run: echo "TODO" # - name: Commit changes From 670423cf7d9921e1b170ac362d39707fc49c34a8 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 20 Oct 2023 11:10:20 +1100 Subject: [PATCH 19/19] missing semicolon --- .github/workflows/force-release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/force-release.yaml b/.github/workflows/force-release.yaml index 76cfab336d..ecaec5f31c 100644 --- a/.github/workflows/force-release.yaml +++ b/.github/workflows/force-release.yaml @@ -40,21 +40,21 @@ jobs: sed -i "s/define SBP_MAJOR_VERSION .*/define SBP_MAJOR_VERSION $MAJOR/" c/include/libsbp/version.h sed -i "s/define SBP_MINOR_VERSION .*/define SBP_MINOR_VERSION $MINOR/" c/include/libsbp/version.h sed -i "s/define SBP_PATCH_VERSION .*/define SBP_PATCH_VERSION $PATCH/" c/include/libsbp/version.h - if [ $PREP_NEXT ] then + if [ $PREP_NEXT ]; then sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH-alpha\"/" c/include/libsbp/version.h else sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH\"/" c/include/libsbp/version.h fi - name: Update Haskell version run: | - if [ $PREP_NEXT ] then + if [ $PREP_NEXT ]; then sed -i "0,/^version: .*/s//version: $MAJOR.$MINOR.$PATCH-alpha/" haskell/sbp.cabal else sed -i "0,/^version: .*/s//version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal fi - name: Update Javascript version run: | - if [ $PREP_NEXT ] then + if [ $PREP_NEXT ]; then echo -n "$MAJOR.$MINOR.$PATCH-alpha" > javascript/sbp/RELEASE-VERSION jq --arg v "$MAJOR.$MINOR.$PATCH-alpha" '.version = $v' package.json > tmp1.$$.json && mv tmp1.$$.json package.json jq --arg v "$MAJOR.$MINOR.$PATCH-alpha" '.version = $v | .packages[""].version = $v' package-lock.json > tmp2.$$.json && mv tmp2.$$.json package-lock.json @@ -68,7 +68,7 @@ jobs: echo -n "$MAJOR.$MINOR.$PATCH" > python/sbp/RELEASE-VERSION - name: Update Rust version run: | - if [ $PREP_NEXT ] then + if [ $PREP_NEXT ]; then sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml sed -i "0,/version = \".*\"/s//version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml else