-
Notifications
You must be signed in to change notification settings - Fork 6
63 lines (56 loc) · 2.01 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Release to 3.4 channels
on:
push:
branches:
- 3.4/*
jobs:
release_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract branch metadata
shell: bash
run: |
BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
echo "risk=${BRANCH##*\/}" >> $GITHUB_OUTPUT
echo "track=${BRANCH%*\/*}" >> $GITHUB_OUTPUT
id: branch_metadata
- name: Check consistency between metadata and release branch
run: |
RAW_VERSION=$(yq '(.version|split("-"))[0]' snap/snapcraft.yaml)
MAJOR_MINOR_VERSION=$(echo $RAW_VERSION | sed -n "s/\(^[0-9]*\.[0-9]*\).*/\1/p")
if [ "${MAJOR_MINOR_VERSION}" != "${{ steps.branch_metadata.outputs.track }}" ]; then exit 1; fi
continue-on-error: false
- name: Output Branch Metadata information
run: |
echo "Branch: ${{ steps.branch_metadata.outputs.branch }}"
echo "Track: ${{ steps.branch_metadata.outputs.track }}"
echo "Risk: ${{ steps.branch_metadata.outputs.risk }}"
outputs:
branch: ${{ steps.branch_metadata.outputs.branch }}
track: ${{ steps.branch_metadata.outputs.track }}
risk: ${{ steps.branch_metadata.outputs.risk }}
build:
uses: ./.github/workflows/ci.yaml
publish:
name: Publish Snap
runs-on: ubuntu-latest
timeout-minutes: 5
needs:
- build
- release_checks
steps:
- name: Download built snap file
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.snap-file }}
path: .
- name: Publish built snap to Store
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{ needs.build.outputs.snap-file }}
release: ${{ needs.release_checks.outputs.track }}/${{ needs.release_checks.outputs.risk }}