-
Notifications
You must be signed in to change notification settings - Fork 19
85 lines (76 loc) · 2.19 KB
/
release.yml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release snap
on:
workflow_call:
inputs:
tag:
required: true
type: string
snap:
required: true
type: string
snap-track:
required: true
type: string
commit:
required: true
type: string
secrets:
snapcraft-credential:
required: true
github-token:
required: true
env:
REPO: RocketChat/server-snap
jobs:
publish-snap:
env:
ROCKETCHAT_SNAP: ${{ format('/tmp/{0}', inputs.snap) }}
runs-on: ubuntu-latest
steps:
- name: Download snap
uses: actions/download-artifact@v3
with:
name: snap
path: /tmp
- name: 'Upload to snapstore'
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft-credential }}
with:
snap: ${{ env.ROCKETCHAT_SNAP }}
release: ${{ format('{0}/edge', inputs.snap-track) }}
- name: 'Create release with artifact'
uses: softprops/action-gh-release@v1
with:
files: ${{ env.ROCKETCHAT_SNAP }}
prerelease: false
repository: ${{ env.REPO }}
token: ${{ secrets.github-token }}
name: ${{ inputs.tag }}
tag_name: ${{ inputs.tag }}
body: ${{ format('https://github.com/RocketChat/Rocket.Chat/releases/{0}', inputs.tag) }}
draft: false
fail_on_unmatched_files: true
target_commitish: ${{ inputs.snap-track}}
generate_release_notes: true
repo-actions:
runs-on: ubuntu-latest
needs:
- publish-snap
if: "${{ inputs.commit == 'true' }}"
steps:
- name: 'Clone snap repo'
uses: actions/checkout@v3
with:
repository: ${{ env.REPO }}
token: ${{ secrets.github-token }}
ref: ${{inputs.snap-track}}
- name: 'Update version'
shell: bash
run: sed -i -r '/^version:/ s/ .+/ ${{ inputs.tag }}/' ./snap/snapcraft.yaml
- name: 'Commit snapcraft file'
uses: EndBug/add-and-commit@v9
with:
add: ./snap/snapcraft.yaml
message: 'Bump Rocket.Chat version to ${{ inputs.tag }}'
push: true