-
-
Notifications
You must be signed in to change notification settings - Fork 24
88 lines (77 loc) · 2.77 KB
/
nightly_release.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
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
name: Nightly Release Workflow
on:
schedule:
- cron: '0 0 * * *' # runs daily at 00:00
workflow_dispatch:
jobs:
checkNightly:
name: Check for new commits
runs-on: ubuntu-latest
outputs:
shouldRun: ${{ env.NEW_COMMIT_COUNT > 0 }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to count the commits
- name: Get new commits
run: |
set -x
echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV
mangaworld:
needs: checkNightly
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
uses: ./.github/workflows/mangaworld_build.yaml
secrets: inherit # pass all secrets
animeworld:
needs: checkNightly
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
uses: ./.github/workflows/animeworld_build.yaml
secrets: inherit # pass all secrets
animeworldtv:
needs: checkNightly
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
uses: ./.github/workflows/animeworldtv_build.yaml
secrets: inherit # pass all secrets
novelworld:
needs: checkNightly
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
uses: ./.github/workflows/novelworld_build.yaml
secrets: inherit # pass all secrets
release:
name: Release APK
needs: [ mangaworld, animeworld, novelworld, animeworldtv ]
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
- name: Get tag name
id: get_tag_name
run: |
set -x
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "NIGHTLY_TIME=$(date '+%Y-%m-%d')" >> $GITHUB_ENV
echo "NIGHTLY_TAG=$(date '+%Y_%m_%d')" >> $GITHUB_ENV
- name: Create Nightly Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_unmatched_files: true
prerelease: true
generate_release_notes: true
tag_name: nightly_${{ env.NIGHTLY_TAG }}
name: OtakuWorld Nightly Release ${{ env.NIGHTLY_TIME }}
body: Nightly release of OtakuWorld at ${{ env.NIGHTLY_TIME }}
files: |
${{ github.workspace }}/release-artifacts/**
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: 'Nightly Release of the project {{ EVENT_PAYLOAD.repository.full_name }} has been deployed at ${{ steps.create_release.outputs.url }}.'