Skip to content

Update packer.json

Update packer.json #27

Workflow file for this run

name: Packer
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'config/packer.json'
- 'config/fontmap.txt'
- 'projects/**'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 20
ref: main
- name: Check changed path on 1.12
uses: MarceloPrado/[email protected]
id: changed-1122
with:
paths: projects/1.12.2
- name: Check changed path on 1.16
uses: MarceloPrado/[email protected]
id: changed-116
with:
paths: projects/1.16
- name: Check changed path on 1.16 fabric
uses: MarceloPrado/[email protected]
id: changed-116-fabric
with:
paths: projects/1.16-fabric
- name: Check changed path on 1.18
uses: MarceloPrado/[email protected]
id: changed-118
with:
paths: projects/1.18
- name: Check changed path on 1.18 fabric
uses: MarceloPrado/[email protected]
id: changed-118-fabric
with:
paths: projects/1.18-fabric
- name: Check changed path on 1.19
uses: MarceloPrado/[email protected]
id: changed-119
with:
paths: projects/1.19
# - name: Check changed path on 1.19 fabric
# uses: MarceloPrado/[email protected]
# id: changed-119-fabric
# with:
# paths: projects/1.19-fabric
- name: Build Packer
run: dotnet publish .\src\Packer\Packer.csproj -o ./ -r win-x64 -p:PublishSingleFile=true
- name: Run Packer for 1.12.2
run: ./Packer --version="1.12.2"
if: steps.changed-1122.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.16
run: ./Packer --version="1.16"
if: steps.changed-116.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.16-fabric
run: ./Packer --version="1.16-fabric"
if: steps.changed-116-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.18
run: ./Packer --version="1.18"
if: steps.changed-118.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.18-fabric
run: ./Packer --version="1.18-fabric"
if: steps.changed-118-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.19
run: ./Packer --version="1.19"
if: steps.changed-119.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
# - name: Run Packer for 1.19-fabric
# run: ./Packer --version="1.19-fabric"
# if: steps.changed-119-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Create timestamp
id: create_timestamp
run: echo "::set-output name=timestamp::$(date '+%Y%m%d%H%M%s')"
shell: bash
# Create the release: https://github.com/actions/create-release
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: Snapshot-${{ steps.create_timestamp.outputs.timestamp }}
release_name: 汉化资源包-Snapshot-${{ steps.create_timestamp.outputs.timestamp }}
draft: false
prerelease: false
# Upload release asset: https://github.com/actions/upload-release-asset
- name: Update release asset for 1.12
id: upload-release-asset1
if: steps.changed-1122.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Minecraft-Mod-Language-Package-1.12.2.zip
asset_name: Minecraft-Mod-Language-Package-1.12.2.zip
asset_content_type: application/zip
- name: Update release asset for 1.16
id: upload-release-asset2
if: steps.changed-116.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Minecraft-Mod-Language-Package-1.16.zip
asset_name: Minecraft-Mod-Language-Package-1.16.zip
asset_content_type: application/zip
- name: Update release asset for 1.16-fabric
id: upload-release-asset3
if: steps.changed-116-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Minecraft-Mod-Language-Package-1.16-fabric.zip
asset_name: Minecraft-Mod-Language-Package-1.16-fabric.zip
asset_content_type: application/zip
- name: Update release asset for 1.18
id: upload-release-asset4
if: steps.changed-118.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Minecraft-Mod-Language-Package-1.18.zip
asset_name: Minecraft-Mod-Language-Package-1.18.zip
asset_content_type: application/zip
- name: Update release asset for 1.18-fabric
id: upload-release-asset5
if: steps.changed-118-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Minecraft-Mod-Language-Package-1.18-fabric.zip
asset_name: Minecraft-Mod-Language-Package-1.18-fabric.zip
asset_content_type: application/zip
- name: Update release asset for 1.19
id: upload-release-asset6
if: steps.changed-119.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Minecraft-Mod-Language-Package-1.19.zip
asset_name: Minecraft-Mod-Language-Package-1.19.zip
asset_content_type: application/zip
# - name: Update release asset for 1.18-fabric
# id: upload-release-asset7
# if: steps.changed-119-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Minecraft-Mod-Language-Package-1.19-fabric.zip
# asset_name: Minecraft-Mod-Language-Package-1.19-fabric.zip
# asset_content_type: application/zip
- name: Build Uploader
run: dotnet publish .\src\Uploader\Uploader.csproj -o ./ -r win-x64 -p:PublishSingeFile=true
- name: Run Uploader
run: .\Uploader --host="${{ secrets.SSH_IP }}" --name="${{ secrets.SSH_USER }}" --password="${{ secrets.SSH_PWD }}"