Skip to content

Commit bd680a3

Browse files
authored
Merge pull request #4 from DC23/orffen#76-Release-Automation
orffen#76 release automation
2 parents 0b0e1fa + 87f63a6 commit bd680a3

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

.github/release-drafter.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
categories:
2+
- title: '🚀 Features'
3+
labels:
4+
- 'feature'
5+
- 'enhancement'
6+
- 'core feature'
7+
- title: '🐛 Bug Fixes'
8+
labels:
9+
- 'fix'
10+
- 'bugfix'
11+
- 'bug'
12+
- title: '🧰 Maintenance'
13+
labels:
14+
- 'refactoring'
15+
- 'maintenance'
16+
- title: '📖 Documentation'
17+
labels:
18+
- 'documentation'
19+
template: |
20+
## What's Changed
21+
22+
$CHANGES
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release Creation
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
# Substitute the Manifest and Download URLs in the system.json
16+
- name: Substitute Manifest and Download Links For Versioned Ones
17+
id: sub_manifest_link_version
18+
uses: microsoft/variable-substitution@v1
19+
with:
20+
files: 'system.json'
21+
env:
22+
version: ${{github.event.release.tag_name}}
23+
url: https://github.com/${{github.repository}}
24+
manifest: https://github.com/${{github.repository}}/releases/latest/download/system.json
25+
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}.zip
26+
27+
# Create a zip file with all files required by the module to add to the release
28+
- run: zip -r ./${{github.event.release.tag_name}}.zip system.json template.json LICENSE lang/ module/ styles/ templates/
29+
30+
# Create a release for this specific version
31+
- name: Update Release with Files
32+
id: create_version_release
33+
uses: ncipollo/release-action@v1.12.0
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
name: ${{ github.event.release.name }}
37+
allowUpdates: true # Set this to false if you want to prevent updating existing releases
38+
draft: true
39+
prerelease: false
40+
artifacts: './system.json, ./${{ github.event.release.tag_name }}.zip'
41+
tag: ${{ github.event.release.tag_name }}
42+
body: ${{ github.event.release.body }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release Drafter
2+
3+
on:
4+
# workflow_dispatch allows manual runs so the release notes can be rebuilt after PRs are renamed or relabeled
5+
workflow_dispatch:
6+
push:
7+
# branches to consider in the event; optional, defaults to all
8+
branches:
9+
- main
10+
# pull_request event is required only for autolabeler
11+
pull_request:
12+
# Only following types are handled by the action, but one can default to all as well
13+
types: [opened, reopened, synchronize]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
update_release_draft:
20+
permissions:
21+
# write permission is required to create a github release
22+
contents: write
23+
# write permission is required for autolabeler
24+
# otherwise, read permission is required at least
25+
pull-requests: read
26+
runs-on: ubuntu-latest
27+
steps:
28+
# Drafts your next Release notes as Pull Requests are merged into main
29+
- uses: release-drafter/release-drafter@v6
30+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
31+
# with:
32+
# config-name: my-config.yml
33+
# disable-autolabeler: true
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)