Skip to content

Commit

Permalink
Merge pull request #2 from soumyaDghosh/2204
Browse files Browse the repository at this point in the history
 ci: add workflow automation to webkitgtk-sdk
  • Loading branch information
jnsgruk authored May 28, 2024
2 parents cbfa8dd + 541e0a6 commit 4a9fb9e
Show file tree
Hide file tree
Showing 9 changed files with 302 additions and 34 deletions.
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-content:
name: ⬆️ Promote Content to stable
environment: "2204 Branch"
runs-on: ubuntu-latest
if: |
( !github.event.issue.pull_request )
&& contains(github.event.comment.body, '/promote ')
&& contains(github.event.issue.body, '`webkitgtk-6-gnome-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: "webkitgtk-6-gnome-2204"

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.issue.body, '`webkitgtk-6-gnome-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: "webkitgtk-6-gnome-2204-sdk"
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 webkitgtk-6-gnome-2204

on:
pull_request:
branches: ["**"]
paths:
- "webkitgtk-6-gnome-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: webkitgtk-6-gnome-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 webkitgtk-6-gnome-2204-sdk

on:
pull_request:
branches: ["**"]
paths:
- "webkitgtk-6-gnome-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: webkitgtk-6-gnome-2204-sdk
69 changes: 69 additions & 0 deletions .github/workflows/release-content-to-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release webkitgtk-6-gnome-2204 to candidate

on:
workflow_run:
workflows: ["Release webkitgtk-6-gnome-2204-sdk to candidate"]
types: [completed]
paths:
- "webkitgtk-6-gnome-2204/**"
workflow_dispatch:

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

permissions:
contents: read
issues: write

jobs:
get-architectures:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
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: "webkitgtk-6-gnome-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
id: build-amd64
uses: snapcrafters/ci/release-to-candidate@main
with:
architecture: ${{ matrix.architecture }}
launchpad-token: ${{ secrets.LP_BUILD_SECRET }}
multi-snap: true
snapcraft-project-root: "webkitgtk-6-gnome-2204"
store-token: ${{ secrets.SNAP_STORE_CANDIDATE }}
repo-token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}

call-for-testing:
if: ${{ github.event_name != 'workflow_dispatch' }}
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:
snapcraft-project-root: "webkitgtk-6-gnome-2204"
architectures: ${{ needs.get-architectures.outputs.architectures }}
github-token: ${{ secrets.GITHUB_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/release-sdk-to-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release webkitgtk-6-gnome-2204-sdk to candidate

on:
# Run the workflow each time new commits are pushed to the candidate branch.
push:
branches: ["2204"]
paths:
- "webkitgtk-6-gnome-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: "webkitgtk-6-gnome-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 }}
launchpad-token: ${{ secrets.LP_BUILD_SECRET }}
multi-snap: true
snapcraft-project-root: "webkitgtk-6-gnome-2204-sdk"
store-token: ${{ secrets.SNAP_STORE_CANDIDATE }}
repo-token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}

call-for-testing:
name: 📣 Create call for testing
needs: [release-sdk, 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:
snapcraft-project-root: "webkitgtk-6-gnome-2204-sdk"
architectures: ${{ needs.get-architectures.outputs.architectures }}
github-token: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/update-sdk-snap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Update SDK Snap

on:
# Runs at 10:00 UTC every day
schedule:
- cron: "0 10 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

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

jobs:
sync-sdk:
name: Sync version of the SDK snap with upstream
environment: "2204 Branch"
runs-on: ubuntu-latest
steps:
- name: Sync version with upstream
uses: snapcrafters/ci/sync-version@main
id: sync-sdk-version
with:
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
branch: "2204"
snapcraft-project-root: "webkitgtk-6-gnome-2204-sdk"
update-script: |
WEBKITGTK_VERSION=$(git ls-remote --tags --sort='v:refname' https://github.com/WebKit/WebKit.git '*gtk*' | tail --lines=1 | cut --delimiter='/' --fields=3 | rev | cut -c 4- | rev)
yq -i ".parts.webkitgtk-6-gnome-2204-sdk.source-tag = \"$WEBKITGTK_VERSION\"" webkitgtk-6-gnome-2204-sdk/snapcraft.yaml
webkitgtk_version=$(echo $WEBKITGTK_VERSION | cut -c 11-)
yq -i ".version=\"$webkitgtk_version\"" webkitgtk-6-gnome-2204-sdk/snapcraft.yaml
sync-content-version:
needs: sync-sdk
name: Sync version of the content snap with upstream
environment: "2204 Branch"
runs-on: ubuntu-latest
steps:
- name: Sync version with upstream
uses: snapcrafters/ci/sync-version@main
with:
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
branch: "2204"
snapcraft-project-root: "webkitgtk-6-gnome-2204"
update-script: |
WEBKITGTK_VERSION=$(git ls-remote --tags --sort='v:refname' https://github.com/WebKit/WebKit.git '*gtk*' | tail --lines=1 | cut --delimiter='/' --fields=3 | rev | cut -c 4- | rev)
webkitgtk_version=$(echo $WEBKITGTK_VERSION | cut -c 11-)
yq -i ".version=\"$webkitgtk_version\"" webkitgtk-6-gnome-2204/snapcraft.yaml
22 changes: 0 additions & 22 deletions .github/workflows/update.yml

This file was deleted.

20 changes: 8 additions & 12 deletions snap/snapcraft.yaml → webkitgtk-6-gnome-2204-sdk/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
name: webkitgtk-6-gnome-2204-sdk # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: git # just for humans, typically '1.2+git' or '1.3.2'
summary: Web content engine for GTK(SDK) # 79 char long summary
name: webkitgtk-6-gnome-2204-sdk
base: core22
version: "2.44.0"
summary: Web content engine for GTK(SDK)
description: |
SDK snap for Webkitgtk-6.0+, used with gnome-42-2204 and core22.
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
grade: stable
confinement: strict

parts:
webkitgtk-6-gnome-2204-sdk:
#source: https://webkitgtk.org/releases/webkitgtk-2.40.1.tar.xz
source: https://github.com/WebKit/WebKit.git
source-tag: 'webkitgtk-2.43.1'
source-tag: "webkitgtk-2.44.0"
source-depth: 1
# ext:updatesnap
# version-format:
# format: 'webkitgtk-%M.%m.%R'
plugin: cmake
cmake-parameters:
- -DPORT=GTK
Expand All @@ -27,12 +24,12 @@ parts:
- -DCMAKE_SKIP_RPATH=ON
- -DUSE_AVIF=ON
- -DUSE_GTK4=ON
- -DUSE_LIBBACKTRACE=OFF
- -DUSE_JPEGXL=OFF
- -DENABLE_JOURNALD_LOG=OFF
- -DENABLE_DOCUMENTATION=OFF
- -DENABLE_MINIBROWSER=ON
build-packages:
- android-libbacktrace-dev
- bubblewrap
- gettext
- gperf
Expand Down Expand Up @@ -93,7 +90,6 @@ parts:
sed -i 's#libdir=/usr/lib#libdir=${exec_prefix}/lib#' $PC
done
stage-packages:
- android-libbacktrace-dev
- bubblewrap
- gstreamer1.0-libav
- libgstreamer-plugins-bad1.0-0
Expand Down
25 changes: 25 additions & 0 deletions webkitgtk-6-gnome-2204/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: webkitgtk-6-gnome-2204
base: core22
version: "2.44.0"
summary: Web content engine for GTK
description: |
Content snap for Webkitgtk-6.0+
grade: stable
confinement: strict

slots:
webkitgtk-6-gnome-2204:
interface: content
read:
- /

parts:
webkitgtk:
plugin: nil
stage-snaps: [webkitgtk-6-gnome-2204-sdk/latest/candidate]
prime:
- -usr/include
- -usr/lib/*/pkgconfig
- -meta*
- -snap*

0 comments on commit 4a9fb9e

Please sign in to comment.