-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (45 loc) · 1.76 KB
/
release-announcement.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
name: Announce Release
on:
workflow_run:
workflows: [Automated Release]
types:
- completed
jobs:
announce:
name: Send Announcements
runs-on: ubuntu-latest
steps:
- id: checkout
name: Clone Git Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- id: commits
name: Count Commits
run: echo "count=$(git rev-list --count HEAD --since='last week')" >> $GITHUB_OUTPUT
- id: previous
name: Get Last Release
if: steps.commits.outputs.count > 0
run: echo "version=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT
- id: mail
name: Send Mail
if: steps.commits.outputs.count > 0
uses: dawidd6/action-send-mail@v3
with:
server_address: ${{ secrets.MAIL_SERVER }}
server_port: ${{ secrets.MAIL_PORT }}
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: ${{ github.event.repository.name }} version ${{ steps.previous.outputs.version }} published
body: See https://github.com/metio/yosql/releases/tag/${{ steps.previous.outputs.version }} for details.
to: ${{ secrets.MAIL_RECIPIENT }}
from: ${{ secrets.MAIL_SENDER }}
- id: matrix
name: Send Matrix Message
if: steps.commits.outputs.count > 0
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: ${{ github.event.repository.name }} version [${{ steps.previous.outputs.version }}](https://github.com/metio/yosql/releases/tag/${{ steps.previous.outputs.version }}) published
server: ${{ secrets.MATRIX_SERVER }}