2022-04-10 19:51:34 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2021-present 351ELEC
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2022-04-10 19:51:34 +00:00
|
|
|
|
|
|
|
### Based on work by @pkegg
|
|
|
|
|
|
|
|
name: release-dev
|
|
|
|
on:
|
2022-07-12 12:08:28 +00:00
|
|
|
schedule:
|
2023-07-20 20:56:42 +00:00
|
|
|
- cron: '0 12 * * *'
|
2022-04-10 19:51:34 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
|
|
BRANCH: dev
|
|
|
|
|
|
|
|
jobs:
|
2022-04-11 22:15:27 +00:00
|
|
|
launch-dev-release:
|
2022-12-31 13:54:53 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2022-06-04 13:43:31 +00:00
|
|
|
if: |
|
2022-06-04 13:55:36 +00:00
|
|
|
${{ github.event_name == 'workflow_dispatch' }} ||
|
2022-06-04 14:03:21 +00:00
|
|
|
${{ github.event.label.name == 'build' }}
|
2022-04-10 19:51:34 +00:00
|
|
|
steps:
|
2022-12-31 14:01:28 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-10 19:51:34 +00:00
|
|
|
name: checkout
|
|
|
|
with:
|
|
|
|
clean: false
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: "${{env.BRANCH}}"
|
2022-04-11 22:15:27 +00:00
|
|
|
|
2023-03-25 10:12:51 +00:00
|
|
|
- name: only run on the primary repository
|
|
|
|
if: ${{ !startsWith(github.repository_owner, 'JustEnoughLinuxOS') }}
|
2022-04-11 22:15:27 +00:00
|
|
|
run: exit 0
|
|
|
|
|
2022-04-10 19:51:34 +00:00
|
|
|
- name: repository full name
|
|
|
|
id: full_name
|
|
|
|
run: |
|
2023-01-02 14:15:27 +00:00
|
|
|
echo "full_name=$(git config --get remote.origin.url | sed 's|^.*github.com/||g' | sed 's/.git$//g')" >> $GITHUB_OUTPUT
|
2022-04-12 23:07:28 +00:00
|
|
|
|
2022-07-12 12:08:28 +00:00
|
|
|
- name: change_counter
|
|
|
|
id: counter
|
|
|
|
run: |
|
|
|
|
count="$(git log --after "$(date -d "yesterday" +%Y-%m-%d)" --pretty=format:"* %h: %s" | wc -l)"
|
2023-01-02 14:15:27 +00:00
|
|
|
echo "count=${count}" >> $GITHUB_OUTPUT
|
2022-07-12 12:08:28 +00:00
|
|
|
|
2022-04-10 19:51:34 +00:00
|
|
|
- name: Get date for artifacts
|
|
|
|
id: date
|
2023-01-02 14:15:27 +00:00
|
|
|
run: echo "date=$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
|
2022-04-10 19:51:34 +00:00
|
|
|
|
|
|
|
- name: Repository Dispatch
|
2022-07-12 12:08:28 +00:00
|
|
|
if: steps.counter.outputs.count != '0'
|
2022-12-31 14:01:28 +00:00
|
|
|
uses: peter-evans/repository-dispatch@v2
|
2022-04-10 19:51:34 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.REPO_ACCESS }}
|
|
|
|
repository: ${{ steps.full_name.outputs.full_name }}
|
|
|
|
event-type: release-dev
|
|
|
|
client-payload: |
|
|
|
|
{
|
|
|
|
"branch" : "${{ env.BRANCH }}",
|
2023-01-06 11:08:23 +00:00
|
|
|
"release_tag" : "${{steps.date.outputs.date}}"
|
2022-04-10 19:51:34 +00:00
|
|
|
}
|
2022-04-12 23:07:28 +00:00
|
|
|
|