forked from zoneminder-containers/eventserver-base
-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (42 loc) · 1.51 KB
/
update-version.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
name: Update Event Server Version
on:
push:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
name: Update Event Server Version
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.GHCR_PAT }}
- name: Update
id: update
run: |
set -x
zm_version=$(wget \
--no-check-certificate -qO - \
https://api.github.com/repos/zoneminder-containers/zoneminder-base/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]')
es_version=$(wget \
--no-check-certificate -qO - \
https://api.github.com/repos/ZoneMinder/zmeventnotification/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]')
export VERSION="zm_v${zm_version}-es_${es_version}"
echo "::set-output name=version::${VERSION}"
- name: Push tag
id: tag_version
run: |
set -x
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git fetch --tags
if [ $(git tag -l "${{ steps.update.outputs.version }}") ]; then
echo "Tag ${{ steps.update.outputs.version }} already exists! Skipping tag creation."
else
echo "Creating tag ${{ steps.update.outputs.version }}"
git tag "${{ steps.update.outputs.version }}"
git push origin "${{ steps.update.outputs.version }}"
fi