-
Notifications
You must be signed in to change notification settings - Fork 71
53 lines (49 loc) · 1.89 KB
/
release.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
name: AI Horde worker new release
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: read
jobs:
build-n-publish:
name: AI Horde Worker new release
runs-on: ubuntu-latest
steps:
- name: "✔️ Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "📣 Release on push"
id: release
uses: rymndhng/release-on-push-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bump_version_scheme: norelease
use_github_release_notes: true
- name: "✏️ Generate release changelog"
if: ${{ steps.release.outputs.version != '' }}
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: "💾 Commit new version"
if: ${{ steps.release.outputs.version != '' }}
run: |
version=${{ steps.release.outputs.version }}
major=$(echo ${version#v} | cut -d '.' -f 1)
minor=$(echo ${version} | cut -d '.' -f 2)
patch=$(echo ${version} | cut -d '.' -f 3)
sed -i "s/^BRIDGE_VERSION = .*/BRIDGE_VERSION = ${major}/g" ./worker/consts.py
sed -i "s/^RELEASE = f\"{BRIDGE_VERSION}.*\"/RELEASE = f\"{BRIDGE_VERSION}.${minor}.${patch}\"/g" ./worker/consts.py
git config user.email [email protected]
git config user.name github-actions
git commit -am 'version incremented'
git push
- name: "Inform with Discord Webhook"
if: ${{ steps.release.outputs.version != '' }}
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
content: "New version of AI Horde Worker has been released: ${{ steps.release.outputs.version }}. Changelog: https://github.com/Haidra-Org/AI-Horde-Worker/releases/tag/${{ steps.release.outputs.version }}"