Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Commit

Permalink
ci: 暫時支援 1.20 打包 (#349)
Browse files Browse the repository at this point in the history
核心部分的 MultiVersions 腳本尚未重寫,因此還無法靈活設定。
待之後將其重寫並讓整個工作流程更加靈活(而不再需要改這類的東西)
  • Loading branch information
xMikux authored Aug 24, 2023
1 parent 8cea4d8 commit bbc37d4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 24 deletions.
6 changes: 5 additions & 1 deletion .github/scripts/multiversions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ multiversion () {
local version=$1
local pack_path=$pack_path/assets

if [ "$version" = "1.19.x" ]; then
# TODO
# 暫時支援 1.20
if [ "$version" = "1.20.x" ]; then
mixer "Fabric" "main"
elif [ "$version" = "1.19.x" ]; then
mixer "Fabric" "main"
elif [ "$version" = "1.18.x" ]; then
mixer "Fabric" "main"
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/Auto-Packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

### TODO ####
# 以 versions.json 為基準 並減少大多數更新需要設定的東西
# 將 Per Release 寫成可重複使用流程

jobs:
Packer:
name: Packer ${{ matrix.version }}
Expand All @@ -32,7 +36,7 @@ jobs:
strategy:
matrix:
version: [ 1.18.x, 1.19.x ]
version: [ 1.18.x, 1.19.x, 1.20.x ]

uses: ./.github/workflows/ResourcePacker.yml
with:
Expand All @@ -59,8 +63,7 @@ jobs:
uses: geekyeggo/delete-artifact@v2
with:
name: |
ModsTranslationPack-1.18.x
ModsTranslationPack-1.19.x
ModsTranslationPack-*
- name: Move all zip to workdir
run: |
Expand All @@ -69,8 +72,9 @@ jobs:
- name: Make Checksum
id: checksum
run: |
echo "sum-01=$(sha256sum ModsTranslationPack-1.19.x.zip)" >> $GITHUB_OUTPUT
echo "sum-02=$(sha256sum ModsTranslationPack-1.18.x.zip)" >> $GITHUB_OUTPUT
echo "sum-01=$(sha256sum ModsTranslationPack-1.20.x.zip)" >> $GITHUB_OUTPUT
echo "sum-02=$(sha256sum ModsTranslationPack-1.19.x.zip)" >> $GITHUB_OUTPUT
echo "sum-03=$(sha256sum ModsTranslationPack-1.18.x.zip)" >> $GITHUB_OUTPUT
- name: Make Current Time
id: current_time
Expand Down Expand Up @@ -106,4 +110,5 @@ jobs:
```
${{ steps.checksum.outputs.sum-01 }}
${{ steps.checksum.outputs.sum-02 }}
${{ steps.checksum.outputs.sum-03 }}
```
49 changes: 31 additions & 18 deletions .github/workflows/Release-Me.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

### TODO ####
# 以 versions.json 為基準 並減少大多數更新需要設定的東西
# 將 Per Release 寫成可重複使用流程

jobs:
Release-Please:
name: Release Please
Expand Down Expand Up @@ -41,7 +45,7 @@ jobs:

strategy:
matrix:
version: [ 1.18.x, 1.19.x ]
version: [ 1.18.x, 1.19.x, 1.20.x ]

uses: ./.github/workflows/ResourcePacker.yml
with:
Expand All @@ -68,18 +72,18 @@ jobs:
uses: geekyeggo/delete-artifact@v2
with:
name: |
ModsTranslationPack-1.18.x
ModsTranslationPack-1.19.x
ModsTranslationPack-*
- name: Move all zip to workdir
run: |
mv ModsTranslationPack-*/*.zip .
- name: Make Checksum
run: |
SUM0=$(sha256sum ModsTranslationPack-1.19.x.zip)
SUM1=$(sha256sum ModsTranslationPack-1.18.x.zip)
echo -e "$SUM0\n$SUM1" > checksums.txt
SUM0=$(sha256sum ModsTranslationPack-1.20.x.zip)
SUM1=$(sha256sum ModsTranslationPack-1.19.x.zip)
SUM2=$(sha256sum ModsTranslationPack-1.18.x.zip)
echo -e "$SUM0\n$SUM1\n$SUM2" > checksums.txt
- name: Make Changelog
id: changelog
Expand All @@ -103,7 +107,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to Modrinth (1.18.x)
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: cF5VXmkW
modrinth-unfeature-mode: subset
Expand All @@ -113,14 +117,12 @@ jobs:
${{ env.CHANGELOG }}
loaders: minecraft
game-versions: |
1.18
1.18.1
1.18.2
files-primary: ModsTranslationPack-1.18.x.zip
>=1.18
files: ModsTranslationPack-1.18.x.zip
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

- name: Publish to Modrinth (1.19.x)
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: cF5VXmkW
modrinth-unfeature-mode: subset
Expand All @@ -130,10 +132,21 @@ jobs:
${{ env.CHANGELOG }}
loaders: minecraft
game-versions: |
1.19
1.19.1
1.19.2
1.19.3
1.19.4
files-primary: ModsTranslationPack-1.19.x.zip
>=1.19
files: ModsTranslationPack-1.19.x.zip
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

- name: Publish to Modrinth (1.20.x)
uses: Kir-Antipov/[email protected]
with:
modrinth-id: cF5VXmkW
modrinth-unfeature-mode: subset
name: 模組翻譯包 1.20.x ${{ needs.release-please.outputs.tag_name }}
version: ${{ needs.release-please.outputs.tag_name }}
changelog: |
${{ env.CHANGELOG }}
loaders: minecraft
game-versions: |
>=1.20
files: ModsTranslationPack-1.20.x.zip
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

0 comments on commit bbc37d4

Please sign in to comment.