Closed jiribenes closed 2 months ago
I don't understand the issue with the tag: isn't it possible to automatically create and push a tag, which then triggers the release process?
I don't understand the issue with the tag:
It might be nicer to decompose it into two separate workflows in order to share the actual "make a release" CI code instead of duplicating that part.
isn't it possible to automatically create and push a tag, which then triggers the release process?
I'm not sure that actions made by Github Actions can automatically trigger other actions, I'd need to verify that.
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs Here are more details on actions triggering other actions automatically:
When you use the repository's [default]
GITHUB_TOKEN
to perform tasks, events triggered by theGITHUB_TOKEN
will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. For example, if a workflow run pushes code using the repository'sGITHUB_TOKEN
, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.
There are a few ways to go around this: we could for example add a personal token to be used in CI instead.
Since this auto-releases to npm (which is great!), can we also change the README to tell people to install effekt via the npm registry?
Since this auto-releases to npm (which is great!), can we also change the README to tell people to install effekt via the npm registry?
It's severely untested now (the CI never ran!), but if everything goes well, then we can change the README in a few weeks (once we're confident in the release process). The installer in the VSCode plugin https://github.com/effekt-lang/effekt-vscode/pull/20 is also relying on npm
as it's much easier to get the list of versions, check if a version is up to date, etc.
By the way, we'll need to add the NPM secrets to the repository.
I'm testing this CI in https://github.com/jiribenes/effekt-ci-test (except for the NPM part for now). The cronjob should run autorelease every day at 12:00Z UTC to simulate the weekly release schedule a bit quicker.
I'll log my observations here:
✨ what fun ✨ the CI managed to stumble into the "text file busy" problem twice in a single run! https://github.com/effekt-lang/effekt/actions/runs/10634552922/job/29482682022
A controversial question: does the CI that deploys also need to run (all) the tests again?
does the CI that deploys also need to run (all) the tests again?
Au contraire, I think it's the only CI that actually really *does* have to pass all the tests.
I understand what you mean, technically not as long as we maintain the invariant that everything on the main branch went through a successful PR. But we have been known to merge PRs without CI finishing or commit directly, both of which resulted in failing test on the main branch.
I'd keep it so that we watch for flaky tests and similar "oops, failing master
" escapades, especially since it runs at 3AM and we don't really care how long it takes as long as the new version is ready when we wake up :)
EDIT: The version currently here & in my test repo does not run tests.
It's been a month and yet two problems remain:
npm
deployment at allsbt test
sometimes fails... what do we do then? by that time, we've already created a git tag with a new version, we just never release itI think the correct way to proceed is:
npm
deployment, we deploy by hand and then fix the CI.master
, or maybe doing the tests in CI that bumps a version? But what do we do then if it fails? (then we don't have a release at all)WDYT?
I think moving the tests to the ci that creates the version makes sense. Can we automatically rerun the tests a second time? If they still fail it would be good to be notified and abort the release.
I've moved the tests to autorelease.yml
(= before the tag is created).
Tomorrow, I'll investigate if we can somehow rerun the tests on failure (esp. if the failure is "text file busy").
EDIT: See commit & note below.
This PR should now be completely ready for review / discussion. I've modified the PR description to reflect the current state and what the autorelease & deploy CI actually do.
Resolves #533
Was extensively tested in
jiribenes/effekt-ci-test
Description
[
autorelease.yml
] Every Monday at 03:00 UTC (= 05:00 Berlin time as of writing this) or on click [workflow-dispatch], the following happens:run-tests
]X.Y.Z
=>X.{Y + 1}.0
), [calculate-version-and-tag
]sbt
,npm
, andmvn
files, [calculate-version-and-tag
]calculate-version-and-tag
][
deploy.yml
] Whenever a git tag starting withv
gets pushed or whenautorelease.yml
succeeds:build-jar
]build-jar
]build-jar
]release
]release
]publish-npm
]Current version format:
X.Y.Z
Y
so the resulting version isX.{Y + 1}.0
:)Caveats/Wishlist (of the current draft)
M.YY.WW.N
whereN
is zero by default for automatically released versions and nonzero for manual hot-fixes / patches?v0.2.2
. However, we'll still know which git commit the version is from as GitHub Releases remembers the commit.I think there is a way to tell GitHub to make a version tag automatically, but I don't see how right now.EDIT: The bigger problem is: how do we ensure that a git tag push doesn't trigger this again. If one CI event can react to another, then it might be easier to automatically push a tag, and only then do the release the same way as it was -- this would simplify things a lot!npm
as well.It would be really useful forEDIT: We'll see if we can manage without it.jiribenes/effekt-nix
to provide a sha256 hash for each released.tgz
archive.