-
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (136 loc) · 4.64 KB
/
release.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Create Release
on:
push:
branches:
- 'main'
tags:
- '*.*.*'
workflow_dispatch:
permissions:
contents: write
discussions: write
pull-requests: write
jobs:
release:
name: Create Release
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
if: github.ref_type == 'tag'
steps:
# Checkout repository and include git LFS files
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
lfs: true
# Download files from Git LFS and caches them to reduce bandwidth usage
- name: Cache and pull LFS files
uses: ./.github/actions/lfs
# Install PackWiz
- name: Install packwiz
uses: supplypike/setup-bin@v4
with:
uri: 'https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip'
name: 'packwiz'
version: 'linux'
# Update version fields in modpack configs
- name: Update version field in configs
uses: ./.github/actions/config
with:
version: ${{ github.ref_name }}
# Refresh packwiz files (Client)
- name: Refresh Packwiz Index Client
shell: bash
run: |
packwiz refresh
working-directory: ./main
# Commit and push updated files
- name: Update repository
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ github.ref_name }}
branch: main
# Package release (Client)
- name: Build CurseForge Client Modpack
shell: bash
run: |
packwiz curseforge export --output Optim-${{ github.ref_name }}.zip
working-directory: ./main
- name: Build Modrinth Client Modpack
shell: bash
run: |
packwiz modrinth export --output Optim-${{ github.ref_name }}.mrpack
working-directory: ./main
# Upload artifacts of release files
- name: Upload Release Artifacts
uses: actions/upload-artifact@v4
with:
name: Modpack-Release
path: |
./main/Optim-${{ github.ref_name }}.zip
./main/Optim-${{ github.ref_name }}.mrpack
retention-days: 1
# Fetch modpack metadata from the modpack config
- name: Read Modpack Metadata
id: metadata
uses: ./.github/actions/meta
with:
working-directory: ./main
# Generate changelog
- name: Generate changelog
uses: ardalanamini/auto-changelog@v4
id: changelog
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
commit-types: |
feat: New Features
remove: Removed Features
fix: Bug Fixes
build: Build System & Dependencies
perf: Performance Improvements
docs: Documentation
test: Tests
refactor: Refactors
chore: Chores
ci: CI
style: Code Style
revert: Reverts
default-commit-type: Other Changes
release-name: ${{ github.ref_name }}
mention-authors: true
mention-new-contributors: true
include-compare-link: false
include-pr-links: true
include-commit-links: true
semver: true
use-github-autolink: true
# Create release
- name: Create Release Client (GitHub)
uses: softprops/action-gh-release@v2
with:
files: |
./main/Optim-${{ github.ref_name }}.zip
./main/Optim-${{ github.ref_name }}.mrpack
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref_name }}
draft: true
prerelease: false
generate_release_notes: false
body: ${{ steps.changelog.outputs.changelog }}
- name: Create Release Client (Modrinth & CurseForge)
uses: ./.github/actions/release
with:
working-directory: ./main
version: ${{ github.ref_name }}
mod-loader: ${{ steps.metadata.outputs.mod-loader }}
minecraft-version: ${{ steps.metadata.outputs.minecraft-version }}
modrinth: true
curseforge: true
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MODRINTH_ID: ${{ secrets.MODRINTH_ID }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
CURSEFORGE_ID: ${{ secrets.CURSEFORGE_ID }}
changelog: ${{ steps.changelog.outputs.changelog }}