Skip to content

Commit

Permalink
修复Installer版本遗漏替换
Browse files Browse the repository at this point in the history
CI流程更新
  • Loading branch information
ParticleG committed Jul 18, 2024
1 parent c6c6dfa commit 6f7264c
Showing 1 changed file with 44 additions and 36 deletions.
80 changes: 44 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
commit-hash: ${{ steps.git-info.outputs.commit-hash }}
base-name: ${{ steps.assemble-base-name.outputs.base-name }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install lua
run: |
sudo apt-get install lua5.3 -y
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Process app name
Expand Down Expand Up @@ -82,21 +82,16 @@ jobs:
build-list: ./Zenitha/ ./assets/ ./soundbank ./conf.lua ./main.lua ./version.lua
package-path: ${{ env.CORE_LOVE_PACKAGE_PATH }}
- name: Upload core love package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
path: ${{ env.CORE_LOVE_PACKAGE_PATH }}
- name: Add icon to love package
run: |
cp ./.github/build/linux/${{ env.BUILD_TYPE }}/icon.png assets/image/icon.png
zip -u ${{ env.CORE_LOVE_PACKAGE_PATH }} assets/image/icon.png
rm assets/image/icon.png
- name: Rename love package
run: |
mkdir -p ${{ env.OUTPUT_FOLDER }}
mv ${{ env.CORE_LOVE_PACKAGE_PATH }} ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ needs.get-info.outputs.base-name }}_Core
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love
Expand All @@ -119,7 +114,7 @@ jobs:
runs-on: ubuntu-latest
needs: build-core
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Love actions for testing
Expand All @@ -135,7 +130,7 @@ jobs:
OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Process app name
Expand All @@ -147,9 +142,22 @@ jobs:
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
- name: Update Windows template
shell: python3 {0}
run: |
version_string = "${{ needs.get-info.outputs.version-string }}"
file_version = (f"{version_string.replace('.', ',')},0")
with open("./.github/build/windows/${{ env.BUILD_TYPE }}/template.rc", "r+", encoding="utf8") as file:
data = file.read()
data = data\
.replace("@Version", version_string)\
.replace("@FileVersion", file_version)
file.seek(0)
file.truncate()
file.write(data)
- name: Build Windows packages
id: build-packages
uses: 26F-Studio/love-actions-windows@v1
Expand All @@ -165,17 +173,17 @@ jobs:
installer-languages: ChineseSimplified.isl ChineseTraditional.isl English.isl Spanish.isl French.isl Indonesian.isl Japanese.isl Portuguese.isl
output-folder: ${{ env.OUTPUT_FOLDER }}
- name: Upload 32-bit artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ needs.get-info.outputs.base-name }}_Windows_x86
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x86.zip
- name: Upload 64-bit artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ needs.get-info.outputs.base-name }}_Windows_x64
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip
- name: Upload installer artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ needs.get-info.outputs.base-name }}_Windows_installer
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_installer.exe
Expand Down Expand Up @@ -207,7 +215,7 @@ jobs:
OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Process app name
Expand All @@ -220,7 +228,7 @@ jobs:
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '-', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
# - name: Download fmod lib
Expand All @@ -246,7 +254,7 @@ jobs:
version-code: ${{ needs.get-info.outputs.version-code }}
output-folder: ${{ env.OUTPUT_FOLDER }}
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ needs.get-info.outputs.base-name }}_Android_release
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}-release.apk
Expand All @@ -272,7 +280,7 @@ jobs:
OUTPUT_FOLDER: ./build
RELEASE_FOLDER: ./release
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Process app name
Expand All @@ -287,7 +295,7 @@ jobs:
f.write('bundle-id=org.26f-studio.' + product_name + '\n')
f.write('product-name=' + product_name + '\n')
- name: Download core love package
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
- name: Add icon to love package
Expand All @@ -309,12 +317,12 @@ jobs:
product-name: ${{ steps.process-app-name.outputs.product-name }}
output-folder: ${{ env.OUTPUT_FOLDER }}
- name: Upload AppImage artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ needs.get-info.outputs.base-name }}_Linux_AppImage
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage
- name: Upload Debian artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ needs.get-info.outputs.base-name }}_Linux_Debian
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.deb
Expand Down Expand Up @@ -344,7 +352,7 @@ jobs:
# OUTPUT_FOLDER: ./build
# RELEASE_FOLDER: ./release
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: Process app name
Expand All @@ -357,7 +365,7 @@ jobs:
# f.write('bundle-id=org.26f-studio.' + re.sub(r"[^A-Za-z0-9]+", "-", "${{ needs.get-info.outputs.app-name }}") + '\n')
# f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
# - name: Download core love package
# uses: actions/download-artifact@v3
# uses: actions/download-artifact@v4
# with:
# name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
# - name: Build iOS packages
Expand All @@ -382,15 +390,15 @@ jobs:
# external-test: ${{ startsWith(github.ref, 'refs/tags/pre') }}
# store-release: ${{ startsWith(github.ref, 'refs/tags/v') }}
# - name: Upload logs artifact
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: ${{ needs.get-info.outputs.base-name }}_iOS_logs
# path: |
# ${{ env.OUTPUT_FOLDER }}/DistributionSummary.plist
# ${{ env.OUTPUT_FOLDER }}/ExportOptions.plist
# ${{ env.OUTPUT_FOLDER }}/Packaging.log
# - name: Upload ipa artifact
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: ${{ needs.get-info.outputs.base-name }}_iOS_ipa
# path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.ipa
Expand All @@ -417,7 +425,7 @@ jobs:
# OUTPUT_FOLDER: ./build
# RELEASE_FOLDER: ./release
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: Process app name
Expand All @@ -430,7 +438,7 @@ jobs:
# f.write('bundle-id=org.26f-studio.' + re.sub(r"[^A-Za-z0-9]+", "-", "${{ needs.get-info.outputs.app-name }}") + '\n')
# f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
# - name: Download core love package
# uses: actions/download-artifact@v3
# uses: actions/download-artifact@v4
# with:
# name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
# - name: Build macOS packages
Expand All @@ -455,15 +463,15 @@ jobs:
# external-test: ${{ startsWith(github.ref, 'refs/tags/pre') }}
# store-release: ${{ startsWith(github.ref, 'refs/tags/v') }}
# - name: Upload logs artifact
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: ${{ needs.get-info.outputs.base-name }}_macOS_appstore_logs
# path: |
# ${{ env.OUTPUT_FOLDER }}/DistributionSummary.plist
# ${{ env.OUTPUT_FOLDER }}/ExportOptions.plist
# ${{ env.OUTPUT_FOLDER }}/Packaging.log
# - name: Upload pkg artifact
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: ${{ needs.get-info.outputs.base-name }}_macOS_appstore_pkg
# path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg
Expand All @@ -490,7 +498,7 @@ jobs:
# OUTPUT_FOLDER: ./build
# RELEASE_FOLDER: ./release
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: Process app name
Expand All @@ -503,7 +511,7 @@ jobs:
# f.write('bundle-id=org.26f-studio.' + re.sub(r"[^A-Za-z0-9]+", "-", "${{ needs.get-info.outputs.app-name }}") + '\n')
# f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
# - name: Download core love package
# uses: actions/download-artifact@v3
# uses: actions/download-artifact@v4
# with:
# name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
# - name: Build macOS packages
Expand Down Expand Up @@ -535,17 +543,17 @@ jobs:
# dmg-window-position: "200 120"
# dmg-window-size: "1024 604"
# - name: Upload pkg artifact
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: ${{ needs.get-info.outputs.base-name }}_macOS_portable_pkg
# path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg
# - name: Upload dmg artifact
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: ${{ needs.get-info.outputs.base-name }}_macOS_portable_dmg
# path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.dmg
# - name: Upload bare artifact
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: ${{ needs.get-info.outputs.base-name }}_macOS_portable_bare
# path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.zip
Expand Down Expand Up @@ -585,7 +593,7 @@ jobs:
env:
ACTION_TYPE: ${{ fromJSON('[["Development", "Pre-release"], ["Release", "Release"]]')[startsWith(github.ref, 'refs/tags/v')][startsWith(github.ref, 'refs/tags/pre')] }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cleanup
uses: geekyeggo/delete-artifact@v2
with:
Expand Down

0 comments on commit 6f7264c

Please sign in to comment.