Fix: if condition to check file ext
[releng/global-jjb.git] / workflows / release.yaml
1 ---
2 name: Release announcement
3
4 # yamllint disable-line rule:truthy
5 on: push
6
7 jobs:
8   publish:
9     if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
10     runs-on: ubuntu-latest
11     steps:
12       - name: Checkout repository
13         uses: actions/checkout@v3
14       - name: Get tag
15         id: tag
16         uses: devops-actions/action-get-tag@v1.0.2
17       - name: Convert tag
18         run: >-
19           VER=$(echo "${{ steps.tag.outputs.tag }}" | tr . -)
20           echo "ANCHOR=${VER}" >> $GITHUB_ENV
21       - name: Notify mailing list
22         uses: dawidd6/action-send-mail@v3
23         with:
24           server_address: ${{ vars.MAIL_SERVER }}
25           server_port: ${{ vars.MAIL_SERVER_PORT }}
26           secure: true
27           username: ${{ secrets.MAIL_USER }}
28           password: ${{ secrets.MAIL_PASSWORD }}
29           subject: global-jjb ${{ steps.tag.outputs.tag }} released
30           to: lf-releng@lists.linuxfoundation.org
31           from: ${{ vars.MAIL_FROM }}
32           body: |
33             Hi Everyone,
34
35             global-jjb ${{ steps.tag.outputs.tag }} is released. Thanks to everyone who contributed
36             to this release. Release notes are avaiable online at:
37
38             https://docs.releng.linuxfoundation.org/projects/global-jjb/en/stable/release-notes.html#${{ env.ANCHOR }}
39
40             Cheers,
41             LF Releng