-
-
Notifications
You must be signed in to change notification settings - Fork 83
92 lines (90 loc) · 3.44 KB
/
auto-publish.yml
File metadata and controls
92 lines (90 loc) · 3.44 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
87
88
89
90
91
92
name: Automatically publish to Modrinth and CurseForge
on:
release:
types: [published]
jobs:
publish-to-curseforge:
if: github.repository_owner == 'Fabulously-Optimized'
runs-on: ubuntu-24.04
timeout-minutes: 30
environment: github-actions
permissions:
contents: write
steps:
- name: Download pack files
uses: robinraju/release-downloader@28fc21f50d76778e7023361aa1f863e717d3d56f # v1.13
id: download-files
with:
fileName: "*.zip"
latest: true
tarBall: false
zipBall: false
preRelease: true
- name: Publish to CurseForge
uses: Kira-NT/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 # v3.3.0
with:
name: ${{ steps.download-files.outputs.tag_name }} for ${{ vars.MC_VERSION }}
curseforge-id: 396246
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-files: '*.zip'
loaders: fabric
game-versions: ${{ vars.MC_VERSION }}
publish-to-modrinth:
if: github.repository_owner == 'Fabulously-Optimized'
runs-on: ubuntu-24.04
timeout-minutes: 30
environment: github-actions
permissions:
attestations: write
artifact-metadata: write
contents: write
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Download packwiz
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: "Linux 64-bit x86"
github-token: ${{ secrets.GH_PAT }}
repository: ${{ vars.PACKWIZ_REPO }}
run-id: ${{ vars.PACKWIZ_RUN_ID }}
- name: Export to packwiz
run: |
chmod +x ./packwiz
pushd Packwiz/${VARS_MC_VERSION}
../../packwiz modrinth export -o ../../Fabulously.Optimized-${GITHUB_REF_NAME}.mrpack
popd
env:
VARS_MC_VERSION: ${{ vars.MC_VERSION }}
- name: Attest mrpack
id: attest-mrpack
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: Fabulously.Optimized-${{ github.ref_name }}.mrpack
- name: Copy and zip attestation
run: |
cp ${STEPS_ATTEST_MRPACK_OUTPUTS_BUNDLE_PATH} cosign-bundle.json
zip cosign-bundle.zip cosign-bundle.json
env:
STEPS_ATTEST_MRPACK_OUTPUTS_BUNDLE_PATH: ${{ steps.attest-mrpack.outputs.bundle-path }}
- name: Publish to Modrinth
uses: Kira-NT/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 # v3.3.0
with:
name: ${{ github.ref_name }} for ${{ vars.MC_VERSION }}
modrinth-id: 1KVo5zza
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-unfeature-mode: none
files: |
Fabulously.Optimized-${{ github.ref_name }}.mrpack
cosign-bundle.zip
loaders: fabric
game-versions: ${{ vars.MC_VERSION }}
- name: Upload to Github
uses: Shopify/upload-to-release@c77c9b3e5d288adaef98a7007bf92340ec6ce03b # v2.0.0
with:
name: Fabulously.Optimized-${{ github.ref_name }}.mrpack
path: Fabulously.Optimized-${{ github.ref_name }}.mrpack
repo-token: ${{ secrets.GITHUB_TOKEN }}