70 lines
2.3 KiB
YAML
70 lines
2.3 KiB
YAML
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
# Copyright (C) 2021-present 351ELEC
|
|
# Copyright (C) 2022-present Fewtarius
|
|
|
|
### Based on work by @pkegg
|
|
|
|
name: release-dev
|
|
on:
|
|
schedule:
|
|
- cron: '0 21 * * *'
|
|
workflow_dispatch:
|
|
env:
|
|
BRANCH: dev
|
|
|
|
jobs:
|
|
launch-dev-release:
|
|
runs-on: ubuntu-20.04
|
|
if: |
|
|
${{ github.event_name == 'workflow_dispatch' }} ||
|
|
${{ github.event.label.name == 'build' }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
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 "::set-output name=full_name::$(git config --get remote.origin.url | sed 's|^.*github.com/||g' | sed 's/.git$//g')"
|
|
|
|
- name: changes
|
|
id: changes
|
|
run: |
|
|
release_notes="$(git log --after "$(date -d "yesterday" +%Y-%m-%d)" --pretty=format:"* %h: %s")"
|
|
release_notes="${release_notes//'%'/'%25'}"
|
|
release_notes="${release_notes//$'\n'/'%0A'}"
|
|
release_notes="${release_notes//$'\r'/'%0D'}"
|
|
echo ::set-output name=release_notes::${release_notes}
|
|
|
|
- name: change_counter
|
|
id: counter
|
|
run: |
|
|
count="$(git log --after "$(date -d "yesterday" +%Y-%m-%d)" --pretty=format:"* %h: %s" | wc -l)"
|
|
echo "::set-output name=count::${count}"
|
|
|
|
- name: Get date for artifacts
|
|
id: date
|
|
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M')"
|
|
|
|
- name: Repository Dispatch
|
|
if: steps.counter.outputs.count != '0'
|
|
uses: peter-evans/repository-dispatch@v1
|
|
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}}",
|
|
"release_notes" : ${{toJSON(steps.changes.outputs.release_notes)}}
|
|
}
|
|
|