|
1 | 1 | name: 'Build debian packages for Cuttlefish host' |
2 | 2 | inputs: |
| 3 | + deploy-channel: |
| 4 | + required: false |
3 | 5 | yyyymmddhhmm: |
4 | 6 | required: false |
5 | 7 | runs: |
6 | 8 | using: "composite" |
7 | 9 | steps: |
8 | | - - name: Modify version with datetime |
9 | | - if: inputs.yyyymmddhhmm != '' |
| 10 | + - name: Modify version format |
| 11 | + if: inputs.deploy-channel != '' |
10 | 12 | run: | |
11 | | - # Modify debian/changelog to build debian package with desired version |
12 | | - # format. |
13 | | - # Stable version format : X.Y.Z |
14 | | - # Unstable/nightly version format : X.Y.Z~gitYYYYMMDDHHMM.<Github SHA 8 digit> |
15 | | - SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8) |
16 | | - SUFFIX="~git${{ inputs.yyyymmddhhmm }}.${SHORT_SHA}" |
17 | | - sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \ |
18 | | - base/debian/changelog |
19 | | - sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \ |
20 | | - frontend/debian/changelog |
| 13 | + case "${{ inputs.deploy-channel }}" in |
| 14 | + stable) |
| 15 | + # Stable version format : X.Y.Z |
| 16 | + SEMVER=$(echo ${{ github.ref_name }} | grep -oE '[0-9]+.[0-9]+.[0-9]+') |
| 17 | + sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(${SEMVER})/g" \ |
| 18 | + base/debian/changelog |
| 19 | + sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(${SEMVER})/g" \ |
| 20 | + frontend/debian/changelog |
| 21 | + ;; |
| 22 | + unstable|nightly) |
| 23 | + # Unstable/nightly version format : X.Y.Z~gitYYYYMMDDHHMM.<Github SHA 8 digit> |
| 24 | + SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8) |
| 25 | + SUFFIX="~git${{ inputs.yyyymmddhhmm }}.${SHORT_SHA}" |
| 26 | + sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \ |
| 27 | + base/debian/changelog |
| 28 | + sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \ |
| 29 | + frontend/debian/changelog |
| 30 | + ;; |
| 31 | + *) |
| 32 | + exit 1 |
| 33 | + ;; |
| 34 | + esac |
21 | 35 | shell: bash |
22 | 36 | - name: Build CF debian packages |
23 | 37 | run: | |
|
0 commit comments