-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Workflow]: Added workflow for automation #9
Conversation
The content snap still needs some work, but hopefully, will fix it asap.
It feels like it might be better to split this down into two distinct sets of files:
At the moment, I don't think the sequencing is quite right, and we appear to adjust the versions for the same files in multiple places. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial comments. Workflow should be
- PR merged and workflow is triggered.
- workflow builds and releases the sdk to a particular channel of candidate. (
candidate/build-${{ github.event.number }}
) - the content snap is then updated to that same release and built.
- two calls for testing.
- sdk, promoted to stable
- content is released to stable
also, checkouts the latest commit on the 2204 branch, updates the manifest.
update-content-snap: | ||
name: Update the content snap | ||
needs: [ release-sdk, get-architectures ] | ||
environment: "2204 Branch" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout latest commit | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }} | ||
- name: Update the content snap | ||
uses: snapcrafters/ci/sync-version@main | ||
with: | ||
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }} | ||
snapcraft-project-root: "ffmpeg-2204" | ||
update-script: | | ||
sed -i 's/^\(- ffmpeg-2204-sdk\/latest\/\)\(.*\)$/\1stable/' ffmpeg-2204/snapcraft.yaml | ||
|
||
release-content: | ||
name: 🚢 Release to latest/stable | ||
needs: get-architectures | ||
runs-on: ubuntu-latest | ||
environment: "2204 Branch" | ||
strategy: | ||
matrix: | ||
architecture: ${{ fromJSON(needs.get-architectures.outputs.architectures-list) }} | ||
steps: | ||
- name: 🚢 Release to latest/stable | ||
uses: snapcrafters/ci/release-to-candidate@main | ||
with: | ||
architecture: ${{ matrix.architecture }} | ||
launchpad-token: ${{ secrets.LP_BUILD_SECRET }} | ||
store-token: ${{ secrets.SNAP_STORE_CANDIDATE }} | ||
channel: "stable" | ||
snapcraft-project-root: "ffmpeg-2204" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get what update-content-snap
and release-content
is doing here. The promote to stable workflow should only promote already built snaps to stable. It should not build anything.
|
||
release-content: | ||
name: 🚢 Release to latest/edge | ||
needs: get-architectures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs update-content-snap
too
architecture: ${{ fromJSON(needs.get-architectures.outputs.architectures-list) }} | ||
steps: | ||
- name: Checkout latest commit | ||
uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still checks out the commit associated with this action; not the latest commit. You can checkout the latest commit using this method: https://github.com/actions/checkout#checkout-head
|
||
call-for-testing: | ||
name: 📣 Create call for testing | ||
needs: [release-sdk, get-architectures] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs release-content
, so the call for testing only gets published when both SDK and content succeed
@merlijn-sebrechts So, in the |
@soumyaDghosh I saw your call for help on this on Matrix. It looks like there is a fair bit of work to do here. The first thing I think we need to do is to have two sets of some of the workflow files that use a path filter - that way we can maintain some seperation such that certain workflows are only triggered by That way we can essentially control the actual release of both snaps independently, which I think is the most sensible way forward. Of course, if one is updated and that needs to trigger the update of another, that's perfectly achievable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments to get started with; I think we'll need a few more iterations but we're making progress. Thanks!
Co-authored-by: Jon Seager <[email protected]>
Co-authored-by: Jon Seager <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking better, a couple more changes!
channel: "candidate" | ||
launchpad-token: ${{ secrets.LP_BUILD_SECRET }} | ||
snapcraft-project-root: "ffmpeg-2204-sdk" | ||
store-token: ${{ secrets.SNAP_STORE_CANDIDATE }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is missing the call for testing phase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is nothing to test in a sdk. The content snap is only what we can test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but we still need a control mechanism for getting newly released revisions from candidate
-> stable
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhh.. we can't directly push it right? Hmm.. is it possible, to promote both to stable together? because that'd make more sense. We don't need to rebuild the content snap twice. Rather, the user needs the exactly same sdk snap, which is used in the content snap. So, promotion will promote both the snap together. Is it possible?
@@ -1,4 +1,4 @@ | |||
name: Update | |||
name: Update SDK Snap | |||
|
|||
on: | |||
# Runs at 10:00 UTC every day |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhere in this workflow you need to call the other update script.
This one runs on a cron job, if changes are made it should call the workflow to also update the content snap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to do that. In the update-content-snap part, I have made it to run only when specific workflow runs
and makes changes depending on the workflow. I am not sure. How to run the update workflow from within this snap. And also, if it's necessary, I think that should be ran after the sdk is published in the candidate channel.
Process:
edge-${{ github.event.number }}
)