-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.75 KB
/
Copy pathrelease-packages.yml
File metadata and controls
52 lines (50 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Release Packages
on:
push:
tags:
- 'utilities/v*'
- 'netcode/v*'
- 'projectilesystem/v*'
workflow_dispatch:
inputs:
package:
description: 'Package to release'
required: true
type: choice
options:
- utilities
- netcode
- projectilesystem
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Determine package
id: pkg
run: |
TAG="${{ github.ref_name }}"
INPUT="${{ github.event.inputs.package }}"
if [[ "$TAG" == utilities* || "$INPUT" == "utilities" ]]; then
echo "name=com.midmanstudio.utilities" >> "$GITHUB_OUTPUT"
echo "path=packages/com.midmanstudio.utilities" >> "$GITHUB_OUTPUT"
elif [[ "$TAG" == netcode* || "$INPUT" == "netcode" ]]; then
echo "name=com.midmanstudio.netcode" >> "$GITHUB_OUTPUT"
echo "path=packages/com.midmanstudio.netcode" >> "$GITHUB_OUTPUT"
elif [[ "$TAG" == projectilesystem* || "$INPUT" == "projectilesystem" ]]; then
echo "name=com.midmanstudio.projectilesystem" >> "$GITHUB_OUTPUT"
echo "path=packages/com.midmanstudio.projectilesystem" >> "$GITHUB_OUTPUT"
else
echo "::error::Could not determine package from tag '$TAG' or input '$INPUT'"
exit 1
fi
- name: Create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: "${{ steps.pkg.outputs.name }} ${{ github.ref_name }}"
body_path: ${{ steps.pkg.outputs.path }}/CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}