From a32c76704df945e18068d344b28ec576a529b82d Mon Sep 17 00:00:00 2001 From: Trevor Lund Date: Wed, 7 Apr 2021 02:52:44 -0500 Subject: [PATCH 01/11] Initial commit for making weekly beta test branches --- .github/workflows/beta.yml | 44 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 4 +++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/beta.yml diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml new file mode 100644 index 00000000..12961c94 --- /dev/null +++ b/.github/workflows/beta.yml @@ -0,0 +1,44 @@ +name: Release next version +on: + schedule: + - cron: '* * * * 5' + push: +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: 'dev' + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y/%m/%d')" + - name: Get current version + id: current-version + run: echo "::set-output name=ver::git describe --tags --abbrev=0 --first-parent | sed 's/^.//'" + - name: Get next version + id: next-version + run: | + ver=`git describe --tags | sed -r 's/^v[0-9]+\.([0-9]+)\.[0-9]+/\1/'` + let ver+=1 + echo "::set-output name=ver::echo $ver" + - name: Install changelog generator + run: sudo gem install github_changelog_generator --version 1.15.2 + - name: Generate Release notes + run: github_changelog_generator --user ${{ github.repository_owner }} --project ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --output temp_change.md --release-branch dev --exclude-labels invalid,duplicate --future-release ${{ steps.next-version.outputs.ver }} --since-tag `git describe --tags --abbrev=0` --max-issues 0 --no-issues true --date-format %Y/%m/%d + - name: Tweak changelogs + run: | + sed -i '$d' temp_change.md + sed -i 's/\[Quotae\]/\[Quote_a\]/' temp_change.md + echo "VERSION[${{ steps.current-version.outputs.ver }}][${{ steps.date.outputs.date }}]" | cat - temp_change.md | sed '2,6d' | sed -e '/^\*\*.*/,+1 d' | sed -r 's/\[\\#.* \(\[(.*)\]\(.*/\(\1\)/' | sed 's/^-/*/' | cat - changelog.txt > changelog_new.txt + cat CHANGELOG.md | sed '1d' >> temp_change.md + mv temp_change.md CHANGELOG.md + mv changelog_new.txt changelog.txt + - name: Update manifest.xml + run: python3 update_manifest.py --quiet --in-place --set-version=${{ github.event.inputs.releaseVersion }} + + - name: Push to beta branch + run: | + git commit -am "Weekly beta-${{ steps.current-version.outputs.ver }} release" --allow-empty --author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" + git push origin beta diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a9ec0e0..d99983d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.releaseVersion }} - name: Install changelog generator run: sudo gem install github_changelog_generator --version 1.15.2 - name: Generate Release notes - run: github_changelog_generator --user ${{ github.repository_owner }} --project ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --output temp_change.md --release-branch dev --exclude-labels invalid,duplicate --future-release ${{ github.event.inputs.releaseVersion }} --since-tag ${{ github.event.inputs.sinceTag }} --max-issues 0 --no-issues true --date-format %Y/%m/%d + run: github_changelog_generator --user ${{ github.repository_owner }} --project ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --output temp_change.md --release-branch ${{ github.event.inputs.releaseVersion }} --exclude-labels invalid,duplicate --future-release ${{ github.event.inputs.releaseVersion }} --since-tag ${{ github.event.inputs.sinceTag }} --max-issues 0 --no-issues true --date-format %Y/%m/%d - name: Tweak changelogs run: > sed -i '$d' temp_change.md; From 9e47ea51e6d0701304ccadb36c485eb3d1a39717 Mon Sep 17 00:00:00 2001 From: Trevor Lund Date: Wed, 7 Apr 2021 03:56:47 -0500 Subject: [PATCH 02/11] Fixed some script errors --- .github/workflows/beta.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 12961c94..604b6f76 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -1,32 +1,38 @@ -name: Release next version +name: Push beta branch on: schedule: - cron: '* * * * 5' push: jobs: - release: + push-beta: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 with: ref: 'dev' + - name: Fetch tags + run: git fetch --prune --unshallow --tags - name: Get current date id: date run: echo "::set-output name=date::$(date +'%Y/%m/%d')" - name: Get current version id: current-version - run: echo "::set-output name=ver::git describe --tags --abbrev=0 --first-parent | sed 's/^.//'" + run: echo "::set-output name=ver::$(git describe --tags --abbrev=0 | sed 's/^.//')" - name: Get next version id: next-version run: | - ver=`git describe --tags | sed -r 's/^v[0-9]+\.([0-9]+)\.[0-9]+/\1/'` - let ver+=1 - echo "::set-output name=ver::echo $ver" + ver=`git describe --tags --abbrev=0` + major=echo $ver | sed -r 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)/\1/' + minor=echo $ver | sed -r 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)/\2/' + patch=echo $ver | sed -r 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)/\3/' + let minor+=1 + semVer="$major.$minor.$patch" + echo "::set-output name=ver::$(echo $semVer)" - name: Install changelog generator run: sudo gem install github_changelog_generator --version 1.15.2 - name: Generate Release notes - run: github_changelog_generator --user ${{ github.repository_owner }} --project ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --output temp_change.md --release-branch dev --exclude-labels invalid,duplicate --future-release ${{ steps.next-version.outputs.ver }} --since-tag `git describe --tags --abbrev=0` --max-issues 0 --no-issues true --date-format %Y/%m/%d + run: github_changelog_generator --user ${{ github.repository_owner }} --project ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --output temp_change.md --release-branch dev --exclude-labels invalid,duplicate --future-release ${{ steps.next-version.outputs.ver }} --since-tag `echo v${{ steps.current-version.outputs.ver }}` --max-issues 0 --no-issues true --date-format %Y/%m/%d - name: Tweak changelogs run: | sed -i '$d' temp_change.md From 315a88a64e6a1d2a0e09d97d1c1e11a47667b1a6 Mon Sep 17 00:00:00 2001 From: Trevor Lund Date: Wed, 7 Apr 2021 04:15:04 -0500 Subject: [PATCH 03/11] Final tweaks --- .github/workflows/beta.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 604b6f76..870f1a06 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -23,9 +23,9 @@ jobs: id: next-version run: | ver=`git describe --tags --abbrev=0` - major=echo $ver | sed -r 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)/\1/' - minor=echo $ver | sed -r 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)/\2/' - patch=echo $ver | sed -r 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)/\3/' + major=$(echo $ver | sed -r 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)/\1/') + minor=$(echo $ver | sed -r 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)/\2/') + patch=$(echo $ver | sed -r 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)/\3/') let minor+=1 semVer="$major.$minor.$patch" echo "::set-output name=ver::$(echo $semVer)" @@ -46,5 +46,7 @@ jobs: - name: Push to beta branch run: | + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" git commit -am "Weekly beta-${{ steps.current-version.outputs.ver }} release" --allow-empty --author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" git push origin beta From 3879250bb0a20446ad9d5081588bb3d1a7fa0de3 Mon Sep 17 00:00:00 2001 From: Trevor Lund Date: Wed, 7 Apr 2021 04:35:18 -0500 Subject: [PATCH 04/11] Swapping branches --- .github/workflows/beta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 870f1a06..b15dc7c8 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - ref: 'dev' + ref: 'beta' - name: Fetch tags run: git fetch --prune --unshallow --tags - name: Get current date @@ -49,4 +49,5 @@ jobs: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git commit -am "Weekly beta-${{ steps.current-version.outputs.ver }} release" --allow-empty --author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" + git rebase origin/dev git push origin beta From 4a38e7e7bd03cc1e1009581adb06f9805fa1800c Mon Sep 17 00:00:00 2001 From: Wires77 Date: Wed, 7 Apr 2021 04:57:44 -0500 Subject: [PATCH 05/11] Removing failed test attempts --- .github/workflows/beta.yml | 1 - .github/workflows/release.yml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index b15dc7c8..0d11256b 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -2,7 +2,6 @@ name: Push beta branch on: schedule: - cron: '* * * * 5' - push: jobs: push-beta: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d99983d0..de2c0c65 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,11 +17,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - ref: ${{ github.event.inputs.releaseVersion }} + ref: 'dev' - name: Install changelog generator run: sudo gem install github_changelog_generator --version 1.15.2 - name: Generate Release notes - run: github_changelog_generator --user ${{ github.repository_owner }} --project ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --output temp_change.md --release-branch ${{ github.event.inputs.releaseVersion }} --exclude-labels invalid,duplicate --future-release ${{ github.event.inputs.releaseVersion }} --since-tag ${{ github.event.inputs.sinceTag }} --max-issues 0 --no-issues true --date-format %Y/%m/%d + run: github_changelog_generator --user ${{ github.repository_owner }} --project ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --output temp_change.md --release-branch dev --exclude-labels invalid,duplicate --future-release ${{ github.event.inputs.releaseVersion }} --since-tag ${{ github.event.inputs.sinceTag }} --max-issues 0 --no-issues true --date-format %Y/%m/%d - name: Tweak changelogs run: > sed -i '$d' temp_change.md; From a938c0484d3e30d8647ab7f963602e15f99c2a06 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Wed, 7 Apr 2021 15:19:47 -0500 Subject: [PATCH 06/11] Add option for enabling beta testing --- src/Modules/Main.lua | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/Modules/Main.lua b/src/Modules/Main.lua index 08bf7689..e056bb7c 100644 --- a/src/Modules/Main.lua +++ b/src/Modules/Main.lua @@ -160,7 +160,7 @@ function main:Init() end self.controls.versionLabel = new("LabelControl", {"BOTTOMLEFT",self.anchorMain,"BOTTOMLEFT"}, 148, -2, 0, 16, "") self.controls.versionLabel.label = function() - return "^8Version: "..launch.versionNumber..(launch.versionBranch == "dev" and " (Dev)" or "") + return "^8Version: "..launch.versionNumber..(launch.versionBranch == "dev" and " (Dev)" or launch.versionBranch == "beta" and " (Beta)" or "") end self.controls.devMode = new("LabelControl", {"BOTTOMLEFT",self.anchorMain,"BOTTOMLEFT"}, 0, -26, 0, 20, "^1Dev Mode") self.controls.devMode.shown = function() @@ -511,6 +511,9 @@ function main:LoadSettings(ignoreBuild) if node.attrib.showTitlebarName then self.showTitlebarName = node.attrib.showTitlebarName == "true" end + if node.attrib.betaTest then + self.betaTest = node.attrib.betaTest == "true" + end end end end @@ -557,6 +560,7 @@ function main:SaveSettings() thousandsSeparator = self.thousandsSeparator, decimalSeparator = self.decimalSeparator, showTitlebarName = tostring(self.showTitlebarName), + betaTest = tostring(self.betaTest), } }) local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml") if not res then @@ -614,13 +618,18 @@ function main:OpenOptionsPopup() controls.titlebarName = new("CheckBoxControl", {"TOPLEFT",nil,"TOPLEFT"}, 230, 160, 20, "Show build name in window title:", function(state) self.showTitlebarName = state end) + controls.betaTest = new("CheckBoxControl", {"TOPLEFT",nil,"TOPLEFT"}, 230, 182, 20, "Opt-in to weekly beta test builds:", function(state) + self.betaTest = state + end) + controls.betaTest.state = self.betaTest controls.titlebarName.state = self.showTitlebarName local initialNodePowerTheme = self.nodePowerTheme local initialThousandsSeparatorDisplay = self.showThousandsSeparators local initialTitlebarName = self.showTitlebarName local initialThousandsSeparator = self.thousandsSeparator local initialDecimalSeparator = self.decimalSeparator - controls.save = new("ButtonControl", nil, -45, 182, 80, 20, "Save", function() + local initialBetaTest = self.betaTest + controls.save = new("ButtonControl", nil, -45, 204, 80, 20, "Save", function() if controls.proxyURL.buf:match("%w") then launch.proxyURL = controls.proxyType.list[controls.proxyType.selIndex].scheme .. "://" .. controls.proxyURL.buf else @@ -637,17 +646,39 @@ function main:OpenOptionsPopup() if self.mode == "LIST" then self.modes.LIST:BuildList() end + main:SetManifestBranch(self.betaTest and "beta" or "master") main:ClosePopup() end) - controls.cancel = new("ButtonControl", nil, 45, 182, 80, 20, "Cancel", function() + controls.cancel = new("ButtonControl", nil, 45, 204, 80, 20, "Cancel", function() self.nodePowerTheme = initialNodePowerTheme self.showThousandsSeparators = initialThousandsSeparatorDisplay self.thousandsSeparator = initialThousandsSeparator self.decimalSeparator = initialDecimalSeparator self.showTitlebarName = initialTitlebarName + self.betaTest = initialBetaTest main:ClosePopup() end) - self:OpenPopup(450, 218, "Options", controls, "save", nil, "cancel") + self:OpenPopup(450, 240, "Options", controls, "save", nil, "cancel") +end + +function main:SetManifestBranch(branchName) + local xml = require("xml") + local manifestLocation = "manifest.xml" + local localManXML = xml.LoadXMLFile(manifestLocation) + if not localManXML then + manifestLocation = "../manifest.xml" + xml.LoadXMLFile(manifestLocation) + end + if localManXML and localManXML[1].elem == "PoBVersion" then + for _, node in ipairs(localManXML[1]) do + if type(node) == "table" then + if node.elem == "Version" then + node.attrib.branch = branchName + end + end + end + end + xml.SaveXMLFile(localManXML[1], manifestLocation) end function main:OpenUpdatePopup() From 8c758b7c11007271e51b321dc122dd1e751db9ff Mon Sep 17 00:00:00 2001 From: Wires77 Date: Fri, 9 Apr 2021 11:59:42 -0500 Subject: [PATCH 07/11] Update next version number for manifest --- .github/workflows/beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 0d11256b..8eb0dcf4 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -41,7 +41,7 @@ jobs: mv temp_change.md CHANGELOG.md mv changelog_new.txt changelog.txt - name: Update manifest.xml - run: python3 update_manifest.py --quiet --in-place --set-version=${{ github.event.inputs.releaseVersion }} + run: python3 update_manifest.py --quiet --in-place --set-version=${{ steps.next-version.outputs.ver }} - name: Push to beta branch run: | From 637d277bc72ba4b3f7c6c346aaca38e0c849d7f0 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Tue, 13 Apr 2021 02:21:39 -0500 Subject: [PATCH 08/11] Adding a manual trigger since cron is unreliable --- .github/workflows/beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 8eb0dcf4..c32051e1 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -2,6 +2,7 @@ name: Push beta branch on: schedule: - cron: '* * * * 5' + workflow_dispatch: jobs: push-beta: runs-on: ubuntu-latest From d65c510e1766a3468264288d2bb4b597a47841f3 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Thu, 13 May 2021 15:15:25 -0500 Subject: [PATCH 09/11] Run only once a week, not every minute on Friday --- .github/workflows/beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index c32051e1..54f1e117 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -1,7 +1,7 @@ name: Push beta branch on: schedule: - - cron: '* * * * 5' + - cron: '0 0 * * 5' workflow_dispatch: jobs: push-beta: From 7086b9a148caf573fbc5bed66547f34c2501ef7d Mon Sep 17 00:00:00 2001 From: Wires77 Date: Thu, 13 May 2021 16:09:05 -0500 Subject: [PATCH 10/11] Take all changes from dev branch in case of conflicts --- .github/workflows/beta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 54f1e117..d1b4ac4c 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -29,6 +29,8 @@ jobs: let minor+=1 semVer="$major.$minor.$patch" echo "::set-output name=ver::$(echo $semVer)" + - name: Update from dev + run: git rebase -X ours origin/dev - name: Install changelog generator run: sudo gem install github_changelog_generator --version 1.15.2 - name: Generate Release notes @@ -49,5 +51,4 @@ jobs: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git commit -am "Weekly beta-${{ steps.current-version.outputs.ver }} release" --allow-empty --author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" - git rebase origin/dev git push origin beta From 4faff338d443ecb25c27b76db8f4cb949260d974 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Thu, 13 May 2021 16:14:39 -0500 Subject: [PATCH 11/11] Setting committer identity earlier in the process, too --- .github/workflows/beta.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index d1b4ac4c..b3e06931 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -30,7 +30,10 @@ jobs: semVer="$major.$minor.$patch" echo "::set-output name=ver::$(echo $semVer)" - name: Update from dev - run: git rebase -X ours origin/dev + run: | + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git rebase -X ours origin/dev - name: Install changelog generator run: sudo gem install github_changelog_generator --version 1.15.2 - name: Generate Release notes @@ -48,7 +51,5 @@ jobs: - name: Push to beta branch run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" git commit -am "Weekly beta-${{ steps.current-version.outputs.ver }} release" --allow-empty --author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" git push origin beta