Skip to content

Autorelease

Autorelease #1021

Workflow file for this run

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!