Skip to content

Comments

Tl/workflow build snapshots with releases#1

Closed
thlehmann-ionos wants to merge 9 commits intoionos-devfrom
tl/workflow-build-snapshots-with-releases
Closed

Tl/workflow build snapshots with releases#1
thlehmann-ionos wants to merge 9 commits intoionos-devfrom
tl/workflow-build-snapshots-with-releases

Conversation

@thlehmann-ionos
Copy link
Owner

@thlehmann-ionos thlehmann-ionos commented Oct 31, 2024

Change

  • Creates snapshot tag needed to create a release
  • Uses softprops/action-gh-release action to create a release with the build .zip as asset and release configured as prerelease

Proposal for releases

  1. We (manually) create and push a release candidate tag at the same revision the most recent snapshot tag was deployed to the test system (we basically re-tag the revision as "it's on staging now")
  2. An action triggered by the release-candidate tag updates the existing release for this revision to be released now (prerelease = false)
  3. We (manually) create and push a release tag at the same revision the most recent release candidate tag is at

Tips

API request to fetch newest release:

function f() { curl --silent -L  -H "Accept: application/vnd.github+json"  -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/${1}/releases | jq --raw-output '.[0].assets[0].browser_download_url' ; } ; f "thlehmann-ionos/nc-server"

Proposal for the downstream usage

  • The GitLab container build and K8s pipelines could use renovate to scan us for new releases and trigger a container build and deploy on their side

Remarks

Attempt: keeping tag and build + release of tag separate workflows

It was tried having a workflow tagging upon change to ionos-dev and another workflow building upon "snapshot" tag creation. Yet GitHub would not trigger a workflow upon tag creation that another workflow caused. This is a "security" feature that can be circumvented by configuring personal access tokens (PAT), yet I discarded this for being less secure and requiring regular token renewals.

@thlehmann-ionos thlehmann-ionos force-pushed the tl/workflow-build-snapshots-with-releases branch from babc2aa to a3ff87b Compare December 17, 2024 16:18
// If the default is expected to be a boolean, we need to cast the value
$value = $this->config->getUserValue($userId, Application::APP_ID, $key, null);
// If the default value is expected to be a boolean, we need to cast the value
if ($value === null) {

Check notice

Code scanning / Psalm

DocblockTypeContradiction

string does not contain null
$value = $this->config->getUserValue($userId, Application::APP_ID, $key, null);
// If the default value is expected to be a boolean, we need to cast the value
if ($value === null) {
$value = $this->appConfig->getAppValueBool($key, $this->getDefaultConfigValue($key));

Check failure

Code scanning / Psalm

InvalidScalarArgument

Argument 2 of OCP\AppFramework\Services\IAppConfig::getAppValueBool expects bool, but bool|string provided
?>

<div class="section" id="mail_general_settings">
<?php if ($_['mail_smtpmode'] === 'null') { ?>

Check notice

Code scanning / Psalm

PossiblyUndefinedArrayOffset

Possibly undefined array key $_['mail_smtpmode'] on array{mail_smtpmode?: mixed, sendmail_is_available: mixed, ...<array-key, mixed>}
Creates a release from a tag and uses the tag name as artifact name.

Changes:

* Zip name changed: incorporates the tag name
* "write-all" permission requested (needed to create release)
* Runs for tags, not branches

Conflicts:

* Name changed in variable value and Job name
  7eb9541
The action previously failed because it required a tag.

Reading the source it accepts a "tag_name" parameter, which apparently
will create the tag.

The "prerelease" option was added because this sounds reasonable for
snapshot builds.
Inspired by the fact that the "draft" release (previous change)
generated the URL

   https://github.com/<OWNER AND REPO>/releases/tag/untagged-<HASH>

I thought it might not complain about no present tag.

This attempts creating a draft release without a tag.

Benefit: repo is not "polluted" (although this is not too bad) with
snapshot tags.

Let's try it ...
The release is currently not even accessible via the API. One has to
know the link, which is only printed by the create command.

Try to make it searchable
Draft is required, otherwise this error happens:

   Error: ⚠️ GitHub Releases requires a tag

This reverts commit 798bb4d.
@thlehmann-ionos thlehmann-ionos force-pushed the tl/workflow-build-snapshots-with-releases branch 3 times, most recently from dcf510b to ede1d94 Compare December 17, 2024 17:02
@thlehmann-ionos thlehmann-ionos deleted the tl/workflow-build-snapshots-with-releases branch December 18, 2024 08:48
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.

1 participant