distribution/.github/workflows/release-main.yaml

61 lines
1.6 KiB
YAML
Raw Normal View History

2022-04-10 19:51:34 +00:00
# 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-main
2022-04-10 19:53:34 +00:00
on:
2022-10-06 09:16:26 +00:00
push:
paths-ignore:
- '.github/**'
- '*.md'
- 'Dockerfile'
- '.dockerignore'
- '.gitignore'
- 'licenses/**'
- 'tools/**'
branches:
- main
2022-04-10 19:51:34 +00:00
workflow_dispatch:
env:
BRANCH: main
jobs:
launch-main-release-if-needed:
2022-12-31 13:54:53 +00:00
runs-on: ubuntu-22.04
2022-04-10 19:51:34 +00:00
steps:
- uses: actions/checkout@v3
2022-04-10 19:51:34 +00:00
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
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-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')" >> $GITHUB_OUTPUT
2022-04-10 19:51:34 +00:00
- name: Repository Dispatch
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-main
client-payload: |
{
"branch" : "${{ env.BRANCH }}",
"release_tag" : "${{steps.date.outputs.date}}",
}