Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Nightly Build Settings (Pass 2) #1189

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Conversation

WhiredPlanck
Copy link
Collaborator

Pull request

Issue tracker

Fixes will automatically close the related issues

Fixes # N/A

Feature

Describe features of pull request

Code of conduct

Style lint

  • make sytle-lint

Build pass

  • make debug

Manually test

  • Done

Code Review

  1. No wildcards import
  2. Manual build and test pass
  3. GitHub action ci pass
  4. At least one contributor reviews and votes
  5. Can be merged clean without conflicts
  6. PR will be merged by rebase upstream base

Daily build

Login and download artifact at https://github.com/osfans/trime/actions

Additional Info

@WhiredPlanck WhiredPlanck self-assigned this Jan 20, 2024
@Bambooin
Copy link
Collaborator

Seems nightly build will create default tag, this tag will affect the release note which depends on last tag.

https://github.com/ncipollo/release-action

An optional tag for the release. If this is omitted the git ref will be used (if it is a tag).

If we can build nightly only when there are new commits, it's an improvement.

@WhiredPlanck
Copy link
Collaborator Author

@Bambooin The nightly build only run on schedule (specified at UTC 3:00 everyday), and only run when develop branch has new commit:

- cron: '0 0 3 * * * *' # UTC 3:00 daily

if: ${{ github.repository == 'osfans/trime' && github.ref == 'refs/heads/develop' }}

The tag only will be created when we specify one or the value of github.ref is 'refs/tags/<tag_name>'.

@Bambooin
Copy link
Collaborator

The tag only will be created when we specify one or the value of github.ref is 'refs/tags/<tag_name>'.

I mean release.yml, such that when we decide to release v3.2.17 tag, then the last tag is nightly instead of v3.2.16.

- name: Build changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
commitMode: true
configurationJson: |
{
"template": "Change log from #{{FROM_TAG}} to #{{TO_TAG}}: #{{RELEASE_DIFF}}\n#{{UNCATEGORIZED}}",
"pr_template": "- [#{{MERGE_SHA}}] - #{{TITLE}}"
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@WhiredPlanck
Copy link
Collaborator Author

The tag only will be created when we specify one or the value of github.ref is 'refs/tags/<tag_name>'.

I mean release.yml, such that when we decide to release v3.2.17 tag, then the last tag is nightly instead of v3.2.16.

- name: Build changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
commitMode: true
configurationJson: |
{
"template": "Change log from #{{FROM_TAG}} to #{{TO_TAG}}: #{{RELEASE_DIFF}}\n#{{UNCATEGORIZED}}",
"pr_template": "- [#{{MERGE_SHA}}] - #{{TITLE}}"
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Just remove nightly tag, the new nightly configuration should not create a tag on the release.

@WhiredPlanck
Copy link
Collaborator Author

WhiredPlanck commented Jan 21, 2024

Hm, I'm too optimistic. If we don't specify tag or there is no valid git ref, the build will end up with failure. https://github.com/WhiredPlanck/trime-new/actions/runs/7600515837

@Bambooin
Copy link
Collaborator

So we have to find the workaroud on the nightly build without tag.

@WhiredPlanck
Copy link
Collaborator Author

WhiredPlanck commented Jan 21, 2024

So we have to find the workaroud on the nightly build without tag.

@Bambooin Great news: I just find that mikepenz/release-changelog-builder-action actually has a input option called ignorePreReleases. Since we will publish nightly build as a prerelease, it will be useful here.

P.S. Before I discovered this option, I was struggling to write bash scripts to ignore the nightly tag when to generate the changelog, which was a wasted effort 🤣 .

- nightly: run on schedule at UTC 16:00 (GMT+8 0:00) everyday
- nightly: remove existing artifacts
- nightly: only build on the main repo and the default branch
- release & nightly: ignore prerelease when generate the changelog
- release & nightly: always fetch submodule
@WhiredPlanck WhiredPlanck merged commit a1e2d2f into develop Jan 22, 2024
6 checks passed
@WhiredPlanck WhiredPlanck deleted the nightly-build-pass2 branch January 22, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants