Skip to content

Commit

Permalink
Sync beta edge workflow (infra) (#799)
Browse files Browse the repository at this point in the history
* Port edge changes to beta workflow

* Change the link from the repo to the actual build

* Port edge changes to beta workflow

* Change the link from the repo to the actual build

* Port edge changes to beta workflow

* Improved description of step

* Fixed typo
  • Loading branch information
Hook25 authored Oct 27, 2023
1 parent 7105814 commit a9b9fcf
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 59 deletions.
55 changes: 32 additions & 23 deletions .github/workflows/checkbox-core-snap-beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,45 @@ jobs:
fail-fast: false
matrix:
releases: [16, 18, 20, 22]
arch: [amd64, arm64, armhf]
runs-on: [self-hosted, linux, large]
env:
SERIES: series${{ matrix.releases }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }}
name: Checkbox core snap for series${{ matrix.releases }}
# snapcraft remote-build will create a repository with the name decided by the --build-id arg
# URL to this repo echoed below to help debug builds (does not change if the workflow is re-run)
SNAPCRAFT_BUILDER_ID: checkbox${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }}
name: Runtime (Core) ${{ matrix.releases }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Copy over the common files for series${{ matrix.releases }}
- name: Copy over the common files for series ${{ matrix.releases }}
run: |
cd checkbox-core-snap/
sudo apt update && sudo apt install -qq -y python3-setuptools-scm
./prepare.sh $SERIES
- name: add LP credentials
- name: Add LP credentials
run: |
mkdir -p ~/.local/share/snapcraft/provider/launchpad/
echo '${{ secrets.LP_CREDS }}' > ~/.local/share/snapcraft/provider/launchpad/credentials
git config --global user.email "[email protected]"
git config --global user.name "Certification bot"
- uses: Hook25/action-build@707dce252c4f367b6c1afe61ed577f7413cf7912
id: snapcraft
- name: Print Launchpad build repository
run: |
echo "Building at: https://git.launchpad.net/~ce-certification-qa/+snap/$SNAPCRAFT_BUILDER_ID"
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Build the snap
with:
path: checkbox-core-snap/series${{ matrix.releases }}
snapcraft-channel: 7.x/stable
snapcraft-args: remote-build --build-on amd64,arm64,armhf --launchpad-accept-public-upload
action: Hook25/action-build@707dce252c4f367b6c1afe61ed577f7413cf7912
attempt_delay: 600000 # 10min
attempt_limit: 5
with: |
path: checkbox-core-snap/series${{ matrix.releases }}
snapcraft-channel: 7.x/stable
snapcraft-args: remote-build --build-for ${{ matrix.arch }} --launchpad-accept-public-upload --build-id $SNAPCRAFT_BUILDER_ID
- uses: actions/upload-artifact@v3
name: Upload logs on failure
if: failure()
with:
name: snapcraft-log-series${{ matrix.releases }}
Expand All @@ -48,24 +60,21 @@ jobs:
/home/runner/.local/state/snapcraft/log/
checkbox-core-snap/series${{ matrix.releases }}/checkbox*.txt
- uses: actions/upload-artifact@v3
name: Upload the snap as artifact
with:
name: series${{ matrix.releases }}
path: checkbox-core-snap/series${{ matrix.releases }}/*.snap
- name: Check that snapcraft built the expected amount of snaps
run: |
NB_SNAPS=$(find checkbox-core-snap/series${{ matrix.releases }} -maxdepth 1 -type f -name *.snap | wc -l)
if [ ${NB_SNAPS} != "3" ]
then
echo "Error: Snapcraft should have produced 3 snaps, found ${NB_SNAPS} instead."
exit 1
fi
- name: Upload checkbox core snaps to the store
run: |
for snap in checkbox-core-snap/series${{ matrix.releases }}/*.snap
do
echo "Uploading $snap..."
snapcraft upload $snap --release beta
done
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Upload the snap to the store
with:
attempt_delay: 600000 # 10min
attempt_limit: 10
command: |
for snap in checkbox-core-snap/series${{ matrix.releases }}/*.snap ; \
do \
echo "Uploading $snap..." ; \
snapcraft upload $snap --release beta ; \
done
changelog:
runs-on: [self-hosted, linux, large]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checkbox-core-snap-daily-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
git config --global user.name "Certification bot"
- name: Print Launchpad build repository
run: |
echo "Building at: https://git.launchpad.net/~ce-certification-qa/+git/$SNAPCRAFT_BUILDER_ID"
echo "Building at: https://git.launchpad.net/~ce-certification-qa/+snap/$SNAPCRAFT_BUILDER_ID"
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Build the snap
with:
Expand Down
69 changes: 39 additions & 30 deletions .github/workflows/checkbox-snap-beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ jobs:
env:
SERIES: series_${{ matrix.type }}${{ matrix.releases }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }}
name: Checkbox snap for series ${{ matrix.type }}${{ matrix.releases }}
# snapcraft remote-build will create a repository with the name decided by the --build-id arg
# URL to this repo echoed below to help debug builds (does not change if the workflow is re-run)
# as the run_id will not change
SNAPCRAFT_BUILDER_ID: checkbox-${{ matrix.type }}${{ matrix.releases }}-${{ github.run_id }}
name: Frontend ${{ matrix.type }}${{ matrix.releases }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -28,19 +32,27 @@ jobs:
cd checkbox-snap/
sudo apt update && sudo apt install -qq -y python3-setuptools-scm
./prepare_${{ matrix.type }}.sh $SERIES
- name: add LP credentials
- name: Add LP credentials
run: |
mkdir -p ~/.local/share/snapcraft/provider/launchpad/
echo '${{ secrets.LP_CREDS }}' > ~/.local/share/snapcraft/provider/launchpad/credentials
git config --global user.email "[email protected]"
git config --global user.name "Certification bot"
- uses: Hook25/action-build@707dce252c4f367b6c1afe61ed577f7413cf7912
id: snapcraft
- name: Print Launchpad build repository
run: |
echo "Building at: https://git.launchpad.net/~ce-certification-qa/+snap/$SNAPCRAFT_BUILDER_ID"
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Building the snaps
with:
path: checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}
snapcraft-channel: 7.x/stable
snapcraft-args: remote-build --build-on amd64,arm64,armhf --launchpad-accept-public-upload
action: Hook25/action-build@707dce252c4f367b6c1afe61ed577f7413cf7912
attempt_delay: 600000 # 10min
attempt_limit: 5
with: |
path: checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}
snapcraft-channel: 7.x/stable
snapcraft-args: remote-build --build-for amd64,arm64,armhf --launchpad-accept-public-upload --build-id $SNAPCRAFT_BUILDER_ID
- uses: actions/upload-artifact@v3
name: Upload logs on failure
if: failure()
with:
name: snapcraft-log-series-${{ matrix.type }}${{ matrix.releases }}
Expand All @@ -49,32 +61,29 @@ jobs:
/home/runner/.local/state/snapcraft/log/
checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/checkbox*.txt
- uses: actions/upload-artifact@v3
name: Upload the snaps as artifacts
with:
name: series_${{ matrix.type }}${{ matrix.releases }}
path: checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/*.snap
- name: Check that snapcraft built the expected amount of snaps
run: |
NB_SNAPS=$(find checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }} -maxdepth 1 -type f -name *.snap | wc -l)
if [ ${NB_SNAPS} != "3" ]
then
echo "Error: Snapcraft should have produced 3 snaps, found ${NB_SNAPS} instead."
exit 1
fi
- name: Upload checkbox snaps to the store
run: |
for snap in checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/*.snap
do
echo "Uploading $snap..."
if [[ ${{ matrix.type }} == 'classic' ]]; then
if [[ ${{ matrix.releases }} == '22' ]]; then
snapcraft upload $snap --release ${{ matrix.releases }}.04/beta,latest/beta
else
snapcraft upload $snap --release ${{ matrix.releases }}.04/beta
fi
else
snapcraft upload $snap --release ${{ matrix.type }}${{ matrix.releases }}/beta
fi
done
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Upload the snaps to the store
with:
attempt_delay: 600000 # 10min
attempt_limit: 10
command: |
for snap in checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/*.snap ; \
do \
echo "Uploading $snap..." ; \
if [ ${{ matrix.type }} = 'classic' ]; then \
if [ ${{ matrix.releases }} = '22' ]; then \
snapcraft upload $snap --release ${{ matrix.releases }}.04/beta,latest/beta ; \
else \
snapcraft upload $snap --release ${{ matrix.releases }}.04/beta ; \
fi \
else \
snapcraft upload $snap --release ${{ matrix.type }}${{ matrix.releases }}/beta ; \
fi ; \
done
changelog:
runs-on: [self-hosted, linux, large]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checkbox-snap-daily-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
git config --global user.name "Certification bot"
- name: Print Launchpad build repository
run: |
echo "Building at: https://git.launchpad.net/~ce-certification-qa/+git/$SNAPCRAFT_BUILDER_ID"
echo "Building at: https://git.launchpad.net/~ce-certification-qa/+snap/$SNAPCRAFT_BUILDER_ID"
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Building the snaps
with:
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/deb-beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,21 @@ jobs:
git clone -b main https://git.launchpad.net/~hook25/ppa-dev-tools /tmp/ppa-dev-tools
- name: Checkout checkbox monorepo
uses: actions/checkout@v3
- name: Update the PPA recipes and kick-off the builds
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Import to LP, ask for a build and wait result
env:
LP_CREDENTIALS: ${{ secrets.LP_CREDS }}
PYTHONUNBUFFERED: 1
CHECKBOX_REPO: ${{ github.repository }}
with:
attempt_delay: 600000 # 10min
attempt_limit: 3
command: |
tools/release/release_deb_monorepo.py
- name: Generate the github release note
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LP_CREDENTIALS: ${{ secrets.LP_CREDS }}
CHECKBOX_REPO: ${{ github.repository }}
PYTHONUNBUFFERED: 1
run: |
gh release create $(git describe --tags --abbrev=0 --match v*) -d --generate-notes
tools/release/release_deb_monorepo.py
2 changes: 1 addition & 1 deletion .github/workflows/deb-daily-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
fetch-depth: 0
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Check for new commits, push build and wait result
name: Import to LP, ask for a build and wait result
env:
LP_CREDENTIALS: ${{ secrets.LP_CREDS }}
PYTHONUNBUFFERED: 1
Expand Down

0 comments on commit a9b9fcf

Please sign in to comment.