-
Notifications
You must be signed in to change notification settings - Fork 18
147 lines (138 loc) · 6.21 KB
/
nightly-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
# name: Nightly Release Pipeline
# concurrency: nightly-release-pipeline
# on:
# workflow_dispatch:
# schedule: #run once a day
# - cron: '0 0 * * *'
# env:
# pack-file: "pack.toml"
# name: 'Create: Prepare to Dye'
# slug: 'create-prepare-to-dye'
# modrinth-url: 'https://modrinth.com/modpack/create-prepare-to-dye'
# loader: 'forge'
# mc_version: '1.19.2'
# jobs:
# tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: validate JSON and YAML files
# uses: GrantBirki/[email protected]
# tag_and_release:
# runs-on: ubuntu-latest
# outputs:
# new_tag: ${{ steps.tag_version.outputs.new_tag }}
# changelog: ${{ steps.tag_version.outputs.changelog }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# # - name: Get last full release
# # id: get_last_release
# # run: gh release list --repo ${{ github.repository_owner }}/${{ github.event.repository.name }} --limit 1 --json tag_name | jq -r '.[0].tag_name' >> $GITHUB_OUTPUT
# - name: Bump version and push tag
# id: tag_version
# uses: mathieudutour/[email protected]
# with:
# tag_prefix: ''
# custom_release_rules: "dev:patch:Developer experience improvments and changes,tweak:patch:Minor tweaks,feat:minor:Features,fix:patch:Fixes,revert:patch:Reverted Changes,docs:patch:Documentation and Localization,test:patch:Tests and testing related changes,mods:patch:Modlist related changes,ci:patch:Continuous Integration"
# github_token: ${{ secrets.GH_TOKEN }}
# - name: Create a GitHub release
# uses: ncipollo/release-action@v1
# with:
# tag: ${{ steps.tag_version.outputs.new_tag }}
# name: Release ${{ steps.tag_version.outputs.new_tag }}
# body: ${{ steps.tag_version.outputs.changelog }}
# token: ${{ secrets.GH_TOKEN }}
# release:
# needs: [tag_and_release, tests]
# strategy:
# matrix:
# include:
# - platform: modrinth
# file_suffix: mrpack
# - platform: curseforge
# file_suffix: zip
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Install packwiz
# uses: supplypike/setup-bin@v3
# with:
# uri: "https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip"
# name: "packwiz"
# version: "linux"
# - name: Build args
# id: build_args
# run: echo 'name=${{ needs.tag_and_release.outputs.new_tag }}-${{ env.slug }} [forge][${{ matrix.platform }}]' >> $GITHUB_OUTPUT
# # - name: Detect curseforge jars
# # if: matrix.platform == 'curseforge'
# # run: packwiz curseforge detect
# - name: Get unix time
# id: get_time
# run: echo "time=$(date +%s%3N)" >> $GITHUB_OUTPUT
# - name: Update changelog files
# if: matrix.platform == 'modrinth'
# run: |
# cd modpack-update-checker
# echo $(jq -r '.versions[.versions| length] |= . + {"id":"${{ needs.tag_and_release.outputs.new_tag }}","releasedAt":${{ steps.get_time.outputs.time }}}' meta.json) > meta.json
# mkdir versions/${{ needs.tag_and_release.outputs.new_tag }}
# echo "${{ needs.tag_and_release.outputs.changelog }}" > versions/${{ needs.tag_and_release.outputs.new_tag }}/changelog.txt
# cd ../config
# echo $(jq -r '.currentVersion = "${{ needs.tag_and_release.outputs.new_tag }}"' modpack-update-checker/config.json) > modpack-update-checker/config.json
# - name: Update discord presense text
# if: matrix.platform == 'modrinth'
# run: |
# cd kubejs/assets/sdrp/lang
# json=$(jq '."sdrp.logo"="Hanging out with Betsy on version ${{ needs.tag_and_release.outputs.new_tag }}"' en_us.json)
# echo $json > en_us.json
# - name: Build Modpack
# run: packwiz ${{ matrix.platform }} export --output "${{ steps.build_args.outputs.name }}.${{ matrix.file_suffix }}"
# - name: Upload Modpack file to GitHub Releases
# run: |
# gh release upload ${{ needs.tag_and_release.outputs.new_tag }} *.${{ matrix.file_suffix }} \
# --repo ${{ github.repository_owner }}/${{ github.event.repository.name }} \
# --clobber
# env:
# GH_TOKEN: ${{ secrets.GH_TOKEN }}
# - name: Publish to Modrinth
# if: matrix.platform == 'modrinth'
# uses: Kir-Antipov/[email protected]
# with:
# modrinth-id: ${{ vars.MODRINTH_ID }}
# modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
# loaders: ${{ env.loader}}
# game-versions: ${{ env.mc_version}}
# changelog: ${{ needs.tag_and_release.outputs.changelog }}
# files: "*.mrpack"
# version: ${{ needs.tag_and_release.outputs.new_tag }}
# version-type: release
# name: ${{ steps.build_args.outputs.name }}
# - name: Update modrinth description to match reademe
# if: matrix.platform == 'modrinth'
# run: |
# curl -X PATCH \
# -H "Authorization: ${{ secrets.MODRINTH_TOKEN }}" \
# -H "Content-Type: application/json" \
# -d "$(cat README.md | jq -R -s '{body: .}')" \
# https://api.modrinth.com/v2/project/${{ vars.MODRINTH_ID }}
# - name: Pull
# if: matrix.platform == 'modrinth'
# run: git pull
# - name: Commit & Push changes
# if: matrix.platform == 'modrinth'
# uses: actions-js/push@master
# with:
# github_token: ${{ secrets.GH_TOKEN }}
# # - name: Publish to CurseForge
# # if: matrix.platform == 'curseforge'
# # uses: Kir-Antipov/[email protected]
# # with:
# # curseforge-id: ${{ vars.CF_ID }}
# # curseforge-token: ${{ secrets.CF_API_TOKEN }}
# # loaders: forge
# # game-versions: 1.19.2
# # changelog: ${{ needs.tag_and_release.outputs.changelog }}
# # files: "*.zip"
# # version: ${{ needs.tag_and_release.outputs.new_tag }}
# # version-type: release