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 3 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
58 changes: 58 additions & 0 deletions .github/workflows/promote-to-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Promote
soumyaDghosh marked this conversation as resolved.
Show resolved Hide resolved

on:
issue_comment:
types:
- created

permissions:
issues: write

jobs:
promote:
name: ⬆️ Promote to stable
environment: "2204 Branch"
runs-on: ubuntu-latest
if: |
( !github.event.issue.pull_request )
&& contains(github.event.comment.body, '/promote ')
&& 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

update-content-snap:
name: Update the content snap
needs: [ release-sdk, get-architectures ]
environment: "2204 Branch"
runs-on: ubuntu-latest
steps:
- 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
soumyaDghosh marked this conversation as resolved.
Show resolved Hide resolved

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"
17 changes: 17 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Pull Request

on:
pull_request:
branches: [ "**" ]

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
soumyaDghosh marked this conversation as resolved.
Show resolved Hide resolved
112 changes: 112 additions & 0 deletions .github/workflows/release-to-edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Release
soumyaDghosh marked this conversation as resolved.
Show resolved Hide resolved

on:
# Run the workflow each time new commits are pushed to the candidate branch.
push:
branches: [ "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-sdk"

release-sdk:
name: 🚢 Release to latest/edge
soumyaDghosh marked this conversation as resolved.
Show resolved Hide resolved
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/edge
uses: snapcrafters/ci/release-to-candidate@main
with:
architecture: ${{ matrix.architecture }}
channel: "edge-${{ github.event.number }}"
launchpad-token: ${{ secrets.LP_BUILD_SECRET }}
snapcraft-project-root: "ffmpeg-2204-sdk"
store-token: ${{ secrets.SNAP_STORE_CANDIDATE }}

update-content-snap:
name: Update the content snap
needs: [ release-sdk, get-architectures ]
environment: "2204 Branch"
runs-on: ubuntu-latest
steps:
- 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\/\)stable$/\1edge-${{ github.event.number }}/' ffmpeg-2204/snapcraft.yaml

release-content:
name: 🚢 Release to latest/edge
needs: get-architectures
Copy link
Member

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

runs-on: ubuntu-latest
environment: "2204 Branch"
strategy:
matrix:
architecture: ${{ fromJSON(needs.get-architectures.outputs.architectures-list) }}
steps:
- name: 🚢 Release to latest/edge
uses: snapcrafters/ci/release-to-candidate@main
with:
architecture: ${{ matrix.architecture }}
channel: "edge-${{ github.event.number }}"
soumyaDghosh marked this conversation as resolved.
Show resolved Hide resolved
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

call-for-testing:
name: 📣 Create call for testing
needs: [release-sdk, get-architectures]
Copy link
Member

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

environment: "2204 Branch"
runs-on: ubuntu-latest
outputs:
issue-number: ${{ steps.issue.outputs.issue-number }}
steps:
- name: 📣 Create call for testing
id: issue
uses: snapcrafters/ci/call-for-testing@main
with:
architectures: ${{ needs.get-architectures.outputs.architectures }}
github-token: ${{ secrets.GITHUB_TOKEN }}
snapcraft-project-root: "ffmpeg-2204-sdk"

call-for-testing-content:
name: 📣 Create call for testing
needs: [release-content, get-architectures]
environment: "2204 Branch"
runs-on: ubuntu-latest
outputs:
issue-number: ${{ steps.issue.outputs.issue-number }}
steps:
- name: 📣 Create call for testing
id: issue
uses: snapcrafters/ci/call-for-testing@main
with:
architectures: ${{ needs.get-architectures.outputs.architectures }}
github-token: ${{ secrets.GITHUB_TOKEN }}
snapcraft-project-root: "ffmpeg-2204"

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

This file was deleted.

Loading