Skip to content

Commit

Permalink
GitHub Actions Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Dec 20, 2023
1 parent cc21d3c commit b44cd15
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/action-docker-craft-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create Release
on:
workflow_call:
inputs:
milestone:
description: The milestone to tag
required: true
type: string
description:
description: Additional information to add above the changelog in the release
default: ""
required: false
type: string
branch:
description: The branch to tag the release on
default: ""
required: false
type: string
labels:
description: The labels to for the sections of the changelog
default: "Bug 🐞,Dependencies 📦,Feature 🏗,Enhancement ✨"
required: false
type: string
jobs:
generate-changelog:
name: Generate Changelog
runs-on: ubuntu-latest
outputs:
changelog: ${{ steps.changelog.outputs.changelog }}
steps:
- name: Generate changelog
uses: WyriHaximus/github-action-jwage-changelog-generator@v1
id: changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
milestone: ${{ inputs.milestone }}
labels: ${{ inputs.labels }}
- name: Show changelog
run: echo "${CHANGELOG}"
env:
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
53 changes: 50 additions & 3 deletions .github/workflows/package-release-managment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,63 @@ on:
jobs:
required-labels:
name: Required Labels
needs:
- repository-information
if: inputs.disableRequiredLabels == false && github.event_name == 'pull_request'
uses: ./.github/workflows/required-labels.yaml
with:
requiredLabels: ${{ inputs.labels }}
create-release:
name: Craft Release
if: inputs.disableRequiredLabels == false && github.event_name == 'milestone' && contains(fromJSON('["closed"]'), github.event.action)
repository-information:
name: Gather Repository information
runs-on: ubuntu-latest
outputs:
type: ${{ steps.repository-information.outputs.type }}
steps:
- uses: actions/checkout@v4
- uses: DamianReeves/write-file-action@master
id: repository-information
with:
path: /tmp/repository-information.php
contents: |
<?php
$type = 'action-docker';
echo $type, PHP_EOL;
file_put_contents(getenv('GITHUB_OUTPUT'), 'type=' . $type . "\n", FILE_APPEND);
echo file_get_contents(getenv('GITHUB_OUTPUT'));
write-mode: append
- run: cat /tmp/repository-information.php
- run: php /tmp/repository-information.php
- run: rm /tmp/repository-information.php
- run: ls -lasth "$GITHUB_OUTPUT"
create-package-release:
name: Craft Package Release
needs:
- repository-information
if: needs.repository-information.outputs.type == 'package' && inputs.disableRequiredLabels == false && github.event_name == 'milestone' && contains(fromJSON('["closed"]'), github.event.action)
uses: ./.github/workflows/package-craft-release.yaml
with:
milestone: ${{ inputs.milestone }}
description: ${{ inputs.description }}
branch: ${{ inputs.branch }}
labels: ${{ inputs.labels }}
create-action-docker-release:
name: Craft Docker based GitHub Action Release
needs:
- repository-information
if: needs.repository-information.outputs.type == 'action-docker'
uses: ./.github/workflows/action-docker-craft-release.yaml
with:
milestone: ${{ inputs.milestone }}
description: ${{ inputs.description }}
branch: ${{ inputs.branch }}
labels: ${{ inputs.labels }}
debug:
name: Debug
runs-on: ubuntu-latest
needs:
- repository-information
steps:
- run: echo "${{ needs.repository-information.outputs.type }}"
26 changes: 26 additions & 0 deletions .github/workflows/repository-information.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Gather Repository information
on:
workflow_call:
jobs:
repository-information:
name: Gather Repository information
runs-on: ubuntu-latest
outputs:
type: ${{ steps.repository-information.outputs.type }}
steps:
- uses: actions/checkout@v4
- uses: DamianReeves/write-file-action@master
id: repository-information
with:
path: /tmp/repository-information.php
contents: |
<?php
$type = 'action-docker';
echo $type, PHP_EOL;
file_put_contents(getenv('GITHUB_OUTPUT'), 'type=action-docker' . "\n", FILE_APPEND);
write-mode: append
- run: php /tmp/repository-information.php
- run: rm /tmp/repository-information.php

0 comments on commit b44cd15

Please sign in to comment.