-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 2.15 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
name: verify & release
on:
push:
branches:
- master
defaults:
run:
shell: nu {0}
permissions:
contents: write
jobs:
verify-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hustcer/[email protected]
- run: try { git fetch --depth=1 origin +refs/tags/*:refs/tags/* }
- name: Pack
id: pack
run: |
./packwiz refresh
./packwiz modrinth export
$"version=(open ./pack.toml | get version)(char nl)" out>> $env.GITHUB_OUTPUT
$"mc-version=(open ./pack.toml | get versions.minecraft)(char nl)" out>> $env.GITHUB_OUTPUT
- name: Output
env:
version: ${{ steps.pack.outputs.version }}
mc_version: ${{ steps.pack.outputs.mc-version }}
run: |
print $"Version: ($env.version)"
print $"Minecraft version: ($env.mc_version)"
- uses: tj-actions/verify-changed-files@v18
with:
fail-if-changed: true
- name: Autotag
id: autotag
env:
version: ${{ steps.pack.outputs.version }}
run: |
let version = $"v($env.version)"
let untagged = (git tag -l | lines -s | find $version | is-empty)
if $untagged {
print $"pushing tag ($version)"
git config --global user.name 'github-actions[bot]'
git config --global user.email '[email protected]'
git tag $version
git push origin $version
} else {
print "version already tagged"
}
$"created-tag=($untagged)(char nl)" out>> $env.GITHUB_OUTPUT
- uses: softprops/action-gh-release@v1
if: ${{ steps.autotag.outputs.created-tag == 'true' }}
with:
files: '*.mrpack'
tag_name: ${{ steps.pack.outputs.version }}
- uses: Kir-Antipov/[email protected]
if: ${{ steps.autotag.outputs.created-tag == 'true' }}
with:
name: |
Liz's Limited Liability
version: ${{ steps.pack.outputs.version }}
game-versions: ${{ steps.pack.outputs.mc-version }}
modrinth-id: ${{ secrets.MODRINTH_ID }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
files: '*.mrpack'