Skip to content

Commit

Permalink
Merge pull request #4 from DC23/orffen#76-Release-Automation
Browse files Browse the repository at this point in the history
orffen#76 release automation
  • Loading branch information
DC23 authored Nov 27, 2024
2 parents 0b0e1fa + 87f63a6 commit bd680a3
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- 'core feature'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
labels:
- 'refactoring'
- 'maintenance'
- title: '📖 Documentation'
labels:
- 'documentation'
template: |
## What's Changed
$CHANGES
42 changes: 42 additions & 0 deletions .github/workflows/release-creation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release Creation

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

# Substitute the Manifest and Download URLs in the system.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'system.json'
env:
version: ${{github.event.release.tag_name}}
url: https://github.com/${{github.repository}}
manifest: https://github.com/${{github.repository}}/releases/latest/download/system.json
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}.zip

# Create a zip file with all files required by the module to add to the release
- run: zip -r ./${{github.event.release.tag_name}}.zip system.json template.json LICENSE lang/ module/ styles/ templates/

# Create a release for this specific version
- name: Update Release with Files
id: create_version_release
uses: ncipollo/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.event.release.name }}
allowUpdates: true # Set this to false if you want to prevent updating existing releases
draft: true
prerelease: false
artifacts: './system.json, ./${{ github.event.release.tag_name }}.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
35 changes: 35 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release Drafter

on:
# workflow_dispatch allows manual runs so the release notes can be rebuilt after PRs are renamed or relabeled
workflow_dispatch:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: read
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into main
- uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bd680a3

Please sign in to comment.