-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (85 loc) · 3 KB
/
release.yml
File metadata and controls
86 lines (85 loc) · 3 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
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release Version'
required: true
targets:
type: choice
default: all
description: Target release platforms
options:
- all
- Modrinth
- CurseForge
- GitHub
jobs:
verify-workflow:
runs-on: ubuntu-latest
if: github.event.inputs.version == '' || github.event.inputs.targets == ''
steps:
- run: echo "invalid input"
- run: exit 1
release:
name: Release
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create_release.outputs.id }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Zip Content
run: zip -r "CTR-VCR_v${{ github.event.inputs.version }}.zip" . -x ".git/*" ".github/*" "shaders/info/*"
- name: Create Release
if: github.event.inputs.targets == 'all' || github.event.inputs.targets == 'GitHub'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
- name: Upload Release Artifact
if: github.event.inputs.targets == 'all' || github.event.inputs.targets == 'GitHub'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./CTR-VCR_v${{ github.event.inputs.version }}.zip
asset_name: CTR-VCR_v${{ github.event.inputs.version }}.zip
asset_content_type: application/zip
- name: Publish to CurseForge
if: github.event.inputs.targets == 'all' || github.event.inputs.targets == 'CurseForge'
uses: Kira-NT/mc-publish@v3.3.0
with:
name: CTR-VCR v${{ github.event.inputs.version }}
version: v${{ github.event.inputs.version }}
version-type: release
files: ./CTR-VCR_v${{ github.event.inputs.version }}.zip
changelog-file: CHANGELOG.md
loaders:
optifine
iris
game-versions: |
>=1.12.1
curseforge-token: ${{ secrets.CF_API_TOKEN }}
curseforge-id: 1167228
- name: Publish to Modrinth
if: github.event.inputs.targets == 'all' || github.event.inputs.targets == 'Modrinth'
uses: Kira-NT/mc-publish@v3.3.0
with:
name: CTR-VCR v${{ github.event.inputs.version }}
version: v${{ github.event.inputs.version }}
version-type: release
files: ./CTR-VCR_v${{ github.event.inputs.version }}.zip
changelog-file: CHANGELOG.md
loaders:
optifine
iris
game-versions: |
>=1.12.1
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-id: XaonJnsc