-
Notifications
You must be signed in to change notification settings - Fork 18
72 lines (63 loc) · 2.19 KB
/
force_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
64
65
66
67
68
69
70
71
name: (OVERRIDE WARNING) Force release new revision
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
path: server-snap
- name: Set variables
id: prepare
working-directory: server-snap
shell: bash
run: |
track="${{ github.ref_name }}"
current_version=$(yq -e .version snap/snapcraft.yaml)
channels="${track}/edge,${track}/stable"
if [[ $current_version =~ rc ]]; then
channels+=",${track}/candidate"
fi
echo "channels: $channels"
echo "current_version: $current_version"
echo "channels=$channels" >>$GITHUB_OUTPUT
echo "current-version=$current_version" >>$GITHUB_OUTPUT
- name: 'Build the Snap package'
uses: snapcore/action-build@v1
id: snap-build
with:
path: server-snap
- name: 'Clone tests repository'
uses: actions/checkout@v3
with:
repository: debdutdeb/rocket.chat.tests
submodules: true
path: tests
- name: 'Run tests'
shell: bash
env:
ROCKETCHAT_TAG: ${{ steps.prepare.outputs.current-version }}
run: |
sudo apt-get --no-install-recommends install jo jq -y
export ROCKETCHAT_SNAP=$(realpath ${{ steps.snap-build.outputs.snap }})
cd tests &&
bash ./run_snap.bash
- name: 'Upload to snapstore'
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: ${{ steps.snap-build.outputs.snap }}
release: ${{ steps.prepare.outputs.channels }}
- name: 'Notify core team'
if: always()
uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@master
with:
job_name: '*Snap ${{ steps.prepare.outputs.current-version }} publish*'
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
type: ${{ job.status }}
mention: 'debdut.chakraborty'
mention_if: failure