This repository has been archived by the owner on May 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 176
60 lines (51 loc) · 1.82 KB
/
release-dev.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
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2021-present 351ELEC
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
### Based on work by @pkegg
name: release-dev
on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:
env:
BRANCH: dev
jobs:
launch-dev-release:
runs-on: ubuntu-22.04
if: |
${{ github.event_name == 'workflow_dispatch' }} ||
${{ github.event.label.name == 'build' }}
steps:
- uses: actions/checkout@v3
name: checkout
with:
clean: false
fetch-depth: 0
ref: "${{env.BRANCH}}"
- name: only run on the primary repository
if: ${{ !startsWith(github.repository_owner, 'JustEnoughLinuxOS') }}
run: exit 0
- name: repository full name
id: full_name
run: |
echo "full_name=$(git config --get remote.origin.url | sed 's|^.*github.com/||g' | sed 's/.git$//g')" >> $GITHUB_OUTPUT
- name: change_counter
id: counter
run: |
count="$(git log --after "$(date -d "yesterday" +%Y-%m-%d)" --pretty=format:"* %h: %s" | wc -l)"
echo "count=${count}" >> $GITHUB_OUTPUT
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
- name: Repository Dispatch
if: steps.counter.outputs.count != '0'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_ACCESS }}
repository: ${{ steps.full_name.outputs.full_name }}
event-type: release-dev
client-payload: |
{
"branch" : "${{ env.BRANCH }}",
"release_tag" : "${{steps.date.outputs.date}}"
}