-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (79 loc) · 2.57 KB
/
main.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
name: Autorelease
on:
schedule:
- cron: "30 0 * * *"
workflow_dispatch:
inputs:
git-ref:
description: Force release
required: false
jobs:
FetchMap:
runs-on: ubuntu-latest
outputs:
prev_hash: ${{ steps.prev_hash.outputs.prhash }}
post_hash: ${{ steps.post_hash.outputs.pohash }}
steps:
- uses: actions/checkout@v2.3.3
with:
fetch-depth: 0
- id: prev_hash
run: |
echo "::set-output name=prhash::$(git log -1 --format=%h)"
- run: "./oui_update.sh"
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Daily autoupdate
commit_user_name: Vendormap Updater
commit_author: Vendormap Updater <actions@github.com>
- id: post_hash
run: |
echo "::set-output name=pohash::$(git log -1 --format=%h)"
Release:
runs-on: ubuntu-latest
needs: [FetchMap]
steps:
- uses: actions/checkout@v2.3.3
with:
fetch-depth: 0
- id: dbg
env:
PREV_HASH: ${{ needs.FetchMap.outputs.prev_hash }}
POST_HASH: ${{ needs.FetchMap.outputs.post_hash }}
run: |
echo "$PREV_HASH -> $POST_HASH"
- name: Get Previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@master"
- name: Get next version
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1.0"
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: Create Release
if: needs.FetchMap.outputs.prev_hash != needs.FetchMap.outputs.post_hash
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.semvers.outputs.patch }}
release_name: v${{ steps.semvers.outputs.patch }}
draft: false
prerelease: false
- name: tg new update
if: needs.FetchMap.outputs.prev_hash != needs.FetchMap.outputs.post_hash
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
vendormap updated!
- name: tg no updates
if: needs.FetchMap.outputs.prev_hash == needs.FetchMap.outputs.post_hash
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
there is no updates for vendormap!