-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (97 loc) · 3.91 KB
/
blank.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
paths:
- 'VERSION'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
getThisVersion:
# The type of runner that the job will run on
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.content }}
#tagexists: ${{ steps.checkTag.outputs.exists }}
zipname: ${{ github.event.repository.name }}.${{ github.event.repository.updated_at }}.v${{ steps.version.outputs.content }}.zip
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@master
- name: ls
run: ls -al
- name: Read VERSION
id: version
uses: juliangruber/read-file-action@v1
with:
path: VERSION
trim: True
- name: Check tag
uses: mukunku/tag-exists-action@v1.0.0
id: checkTag
with:
tag: '${{ steps.version.outputs.content }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete the tag
if: ${{ steps.checkTag.outputs.exists == true }}
uses: author/action-rollback@stable
with:
tag: ${{ steps.version.outputs.content }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
createrelease:
runs-on: ubuntu-latest
needs: getThisVersion
if: ${{ !(needs.getThisVersion.outputs.version == null) }}
steps:
- name: Display Inputs
run: echo "${{ toJSON (needs.getThisVersion.outputs) }}"
- name: Pull the repo
uses: actions/checkout@master
- name: Zip Folder
run: zip -r ${{ needs.getThisVersion.outputs.zipname }} . -x *.git* folder/**\* ./folder/
- name: Send mail
uses: dawidd6/action-send-mail@v3
with:
# Required mail server address:
server_address: smtp.gmail.com
# Required mail server port:
server_port: 465
# Required mail server username:
username: ${{secrets.MAIL_USERNAME}}
# Required mail server password:
password: ${{secrets.MAIL_PASSWORD}}
# Required mail subject:
subject: A new version (${{ needs.getThisVersion.outputs.version }}) of ${{github.repository}} has been released
# Required recipients' addresses:
to: jon@emills.com.au
# Required sender full name (address can be skipped):
from: Badger @ Github
# Optional whether this connection use TLS (default is true if server_port is 465)
secure: true
# Optional plain body:
body: Release is attached
# Optional HTML body read from file:
#html_body: file://README.html
# Optional carbon copy recipients:
#cc: kyloren@example.com,leia@example.com
# Optional blind carbon copy recipients:
#bcc: r2d2@example.com,hansolo@example.com
# Optional recipient of the email response:
#reply_to: jon@emills.com.au
# Optional unsigned/invalid certificates allowance:
ignore_cert: true
# Optional converting Markdown to HTML (set content_type to text/html too):
convert_markdown: true
# Optional attachments:
attachments: ${{ needs.getThisVersion.outputs.zipname }}
- name: Upload Release
uses: cb80/pubrel@latest
with:
ref: 'refs/tags/${{ needs.getThisVersion.outputs.version }}'
replace: '${{ needs.getThisVersion.outputs.version }}'
files: ${{ needs.getThisVersion.outputs.zipname }}