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

[Workflow]: Added workflow for automation #9

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/promote-to-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Promote to stable

on:
issue_comment:
types:
- created

permissions:
issues: write

jobs:
promote-sdk:
name: ⬆️ Promote SDK to stable
environment: "2204 Branch"
runs-on: ubuntu-latest
if: |
( !github.event.issue.pull_request )
&& contains(github.event.comment.body, '/promote ')
&& contains(github.event.comment.body, ''ffmpeg-2204-sdk')
&& contains(github.event.*.labels.*.name, 'testing')
steps:
- name: ⬆️ Promote to stable
uses: snapcrafters/ci/promote-to-stable@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
store-token: ${{ secrets.SNAP_STORE_STABLE }}
snapcraft-project-root: "ffmpeg-2204-sdk"
jnsgruk marked this conversation as resolved.
Show resolved Hide resolved

promote-sdk:
name: ⬆️ Promote SDK to stable
environment: "2204 Branch"
runs-on: ubuntu-latest
if: |
( !github.event.issue.pull_request )
&& contains(github.event.comment.body, '/promote ')
&& contains(github.event.comment.body, ''ffmpeg-2204 ')
&& contains(github.event.*.labels.*.name, 'testing')
steps:
- name: ⬆️ Promote to stable
uses: snapcrafters/ci/promote-to-stable@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
store-token: ${{ secrets.SNAP_STORE_STABLE }}
snapcraft-project-root: "ffmpeg-2204"
21 changes: 21 additions & 0 deletions .github/workflows/pull-request-content.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Pull Request for ffmpeg-2204

on:
pull_request:
branches: [ "**" ]
paths:
- "ffmpeg-2204/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: 🧪 Build snap on amd64
runs-on: ubuntu-latest
steps:
- name: 🧪 Build snap on amd64
uses: snapcrafters/ci/test-snap-build@main
with:
snapcraft-project-root: ffmpeg-2204
21 changes: 21 additions & 0 deletions .github/workflows/pull-request-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Pull Request for ffmpeg-2204-sdk

on:
pull_request:
branches: [ "**" ]
paths:
- "ffmpeg-2204-sdk/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: 🧪 Build snap on amd64
runs-on: ubuntu-latest
steps:
- name: 🧪 Build snap on amd64
uses: snapcrafters/ci/test-snap-build@main
with:
snapcraft-project-root: ffmpeg-2204-sdk
50 changes: 50 additions & 0 deletions .github/workflows/release-content-to-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release ffmpeg-2204 to candidate

on:
# Run the workflow each time new commits are pushed to the candidate branch.
push:
branches: [ "2204" ]
paths:
- "ffmpeg-2204/**"
workflow_dispatch:


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
issues: write

jobs:
get-architectures:
name: 🖥 Get snap architectures
runs-on: ubuntu-latest
outputs:
architectures: ${{ steps.get-architectures.outputs.architectures }}
architectures-list: ${{ steps.get-architectures.outputs.architectures-list }}
steps:
- name: 🖥 Get snap architectures
id: get-architectures
uses: snapcrafters/ci/get-architectures@main
with:
snapcraft-project-root: "ffmpeg-2204"

release-content:
name: 🚢 Release to latest/candidate
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/candidate
uses: snapcrafters/ci/release-to-candidate@main
with:
architecture: ${{ matrix.architecture }}
channel: "candidate"
launchpad-token: ${{ secrets.LP_BUILD_SECRET }}
snapcraft-project-root: "ffmpeg-2204"
store-token: ${{ secrets.SNAP_STORE_CANDIDATE }}
soumyaDghosh marked this conversation as resolved.
Show resolved Hide resolved
50 changes: 50 additions & 0 deletions .github/workflows/release-sdk-to-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release ffmpeg-2204-sdk to candidate

on:
# Run the workflow each time new commits are pushed to the candidate branch.
push:
branches: [ "2204" ]
paths:
- "ffmpeg-2204-sdk/**"
workflow_dispatch:


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
issues: write

jobs:
get-architectures:
name: 🖥 Get snap architectures
runs-on: ubuntu-latest
outputs:
architectures: ${{ steps.get-architectures.outputs.architectures }}
architectures-list: ${{ steps.get-architectures.outputs.architectures-list }}
steps:
- name: 🖥 Get snap architectures
id: get-architectures
uses: snapcrafters/ci/get-architectures@main
with:
snapcraft-project-root: "ffmpeg-2204-sdk"

release-sdk:
name: 🚢 Release to latest/candidate
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/candidate
uses: snapcrafters/ci/release-to-candidate@main
with:
architecture: ${{ matrix.architecture }}
channel: "candidate"
launchpad-token: ${{ secrets.LP_BUILD_SECRET }}
snapcraft-project-root: "ffmpeg-2204-sdk"
store-token: ${{ secrets.SNAP_STORE_CANDIDATE }}
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

@soumyaDghosh soumyaDghosh Mar 4, 2024

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?

29 changes: 0 additions & 29 deletions .github/workflows/test-snap-can-build.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/update-content-snap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update Content Snap

on:
workflow_run:
soumyaDghosh marked this conversation as resolved.
Show resolved Hide resolved
workflows: ["Release ffmpeg-2204-sdk to candidate", "Promote SDK to stable"]
types: [requested]
paths:
- "ffmpeg-2204/**"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
sync:
name: Sync version with upstream
environment: "Candidate Branch"
runs-on: ubuntu-latest
steps:
- name: Sync version with upstream
uses: snapcrafters/ci/sync-version@main
with:
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
snapcraft-project-root: ffmpeg-2204-sdk
update-script: |
if [[ "${{ github.event.workflow_run.workflow.name }}" == "Release ffmpeg-2204-sdk to candidate" ]]; then
sed -i 's|ffmpeg-2204-sdk/latest/\*\*|ffmpeg-2204-sdk/latest/candidate|g' ffmpeg-2204/snapcraft.yaml
else
sed -i 's|ffmpeg-2204-sdk/latest/\*\*|ffmpeg-2204-sdk/latest/stable|g' ffmpeg-2204/snapcraft.yaml
fi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update
name: Update SDK Snap

soumyaDghosh marked this conversation as resolved.
Show resolved Hide resolved
on:
# Runs at 10:00 UTC every day
Expand Down
1 change: 0 additions & 1 deletion ffmpeg-2204-sdk/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ parts:
make DESTDIR="$CRAFT_PART_INSTALL" install
prime:
- -usr/share
source-tag: release/6.1
prefix-fix:
after: [ffmpeg]
plugin: nil
Expand Down
Loading