From 9833e759cc44bdd065107bdca1232ffab5a550b0 Mon Sep 17 00:00:00 2001 From: ParticleG Date: Sun, 24 Oct 2021 20:15:43 +0800 Subject: [PATCH 1/8] - Testing CI --- .github/workflows/test.yml | 149 +++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..8e513eea --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,149 @@ +name: Techmino Develop CI + +on: + push: + branches: [ pre* ] + pull_request: + branches: [ pre* ] + +jobs: + get-info: + runs-on: ubuntu-20.04 + outputs: + name: ${{ steps.actual-get-info.outputs.name }} + apkCode: ${{ steps.actual-get-info.outputs.apkCode }} + code: ${{ steps.actual-get-info.outputs.code }} + release: ${{ steps.actual-get-info.outputs.release }} + commit: ${{ steps.actual-get-info.outputs.commit }} + steps: + - uses: actions/checkout@v2 + - name: Install lua + run: | + sudo apt-get install lua5.3 -y + - name: Get Version + id: actual-get-info + run: | + echo "::set-output name=name::$(lua .github/workflows/getVersion.lua -name)" + echo "::set-output name=apkCode::$(lua .github/workflows/getVersion.lua -apkCode)" + echo "::set-output name=code::$(lua .github/workflows/getVersion.lua -code)" + echo "::set-output name=release::$(lua .github/workflows/getVersion.lua -release)" + echo "::set-output name=commit::$(git rev-parse --short ${{ GITHUB.SHA }})" + + build-windows: + runs-on: windows-latest + needs: get-info + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/snapshot-update + with: + commit: ${{ needs.get-info.outputs.commit }} + - uses: ./.github/actions/build-windows + with: + love-url: https://github.com/love2d/love/releases/download/11.3/love-11.3-win64.zip + love-dir: love-11.3-win64 + arch: win64 + version: ${{ needs.get-info.outputs.name }} + icon: .\.github\build\Windows\icon_snapshot.ico + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.Windows + path: love + + build-linux: + runs-on: ubuntu-20.04 + needs: get-info + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/snapshot-update + with: + commit: ${{ needs.get-info.outputs.commit }} + - uses: ./.github/actions/build-linux + with: + icon: .github/build/Linux/icon_snapshot.png + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.Linux + path: Techmino.AppImage + + build-android: + runs-on: ubuntu-20.04 + needs: get-info + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/snapshot-update + with: + commit: ${{ needs.get-info.outputs.commit }} + - uses: ./.github/actions/build-android + with: + type: Snapshot + apkCode: ${{ needs.get-info.outputs.apkCode }} + name: ${{ needs.get-info.outputs.name }} + file-path: Techmino_Snapshot.apk + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} + ALIAS: ${{ secrets.ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.Android + path: Techmino_Snapshot.apk + + build-macOS: + runs-on: macos-10.15 + needs: get-info + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/snapshot-update + with: + commit: ${{ needs.get-info.outputs.commit }} + - uses: ./.github/actions/build-macos + with: + name: ${{ needs.get-info.outputs.name }} + icon: .github/build/macOS/icon_snapshot.icns + APPLE_API_ID: '${{ secrets.APPLE_API_ID }}' + APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' + APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' + APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}' + APPLE_KEYCHAIN_NAME: '${{ secrets.APPLE_KEYCHAIN_NAME }}' + APPLE_KEYCHAIN_PWD: '${{ secrets.APPLE_KEYCHAIN_PWD }}' + FASTLANE_MATCH_PWD: '${{ secrets.FASTLANE_MATCH_PWD }}' + FASTLANE_MATCH_TOKEN: '${{ secrets.FASTLANE_MATCH_TOKEN }}' + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.macOS + path: Techmino.dmg + + build-iOS: + runs-on: macos-latest + needs: get-info + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/snapshot-update + with: + commit: ${{ needs.get-info.outputs.commit }} + - uses: ./.github/actions/build-ios + with: + name: ${{ needs.get-info.outputs.name }} + type: 'test' + APPLE_API_ID: '${{ secrets.APPLE_API_ID }}' + APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' + APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' + APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_number }}' + APPLE_APP_CHANGELOG: '${{ github.event.commits[0].message }}' + APPLE_APP_ID: '${{ secrets.APPLE_APP_ID }}' + APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}' + APPLE_APP_PROFILE: '${{ secrets.APPLE_APP_PROFILE }}' + APPLE_DEVELOPER_ACCOUNT: '${{ secrets.APPLE_DEVELOPER_ACCOUNT }}' + APPLE_KEYCHAIN_NAME: '${{ secrets.APPLE_KEYCHAIN_NAME }}' + APPLE_KEYCHAIN_PWD: '${{ secrets.APPLE_KEYCHAIN_PWD }}' + FASTLANE_MATCH_PWD: '${{ secrets.FASTLANE_MATCH_PWD }}' + FASTLANE_MATCH_TOKEN: '${{ secrets.FASTLANE_MATCH_TOKEN }}' + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Techmino.pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}.iOS + path: "Techmino.ipa" From 33acf06a7181a12bf26e8393a4888acf85e7d113 Mon Sep 17 00:00:00 2001 From: ParticleG Date: Sun, 24 Oct 2021 20:19:18 +0800 Subject: [PATCH 2/8] - Change CI name --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e513eea..a6e36688 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Techmino Develop CI +name: Techmino Test CI on: push: From 6167c9f31733cb40d52bebdc14f83085755bf94f Mon Sep 17 00:00:00 2001 From: ParticleG Date: Sun, 24 Oct 2021 20:45:45 +0800 Subject: [PATCH 3/8] - Update badge --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 2af50408..03b48f9f 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ ![platform](https://img.shields.io/badge/platform-windows%20%7C%20linux%20%7C%20android%20%7C%20macos%20%7C%20ios-brightgreen.svg) -[![Techmino Develop CI](https://github.com/26F-Studio/Techmino/actions/workflows/dev.yml/badge.svg)](https://github.com/26F-Studio/Techmino/actions/workflows/dev.yml) [![Techmino Release CI](https://github.com/26F-Studio/Techmino/actions/workflows/release.yml/badge.svg)](https://github.com/26F-Studio/Techmino/actions/workflows/release.yml) +[![Techmino Develop CI](https://github.com/26F-Studio/Techmino/actions/workflows/dev.yml/badge.svg)](https://github.com/26F-Studio/Techmino/actions/workflows/dev.yml) [![Techmino Test CI](https://github.com/26F-Studio/Techmino/actions/workflows/test.yml/badge.svg)](https://github.com/26F-Studio/Techmino/actions/workflows/test.yml) [![Techmino Release CI](https://github.com/26F-Studio/Techmino/actions/workflows/release.yml/badge.svg)](https://github.com/26F-Studio/Techmino/actions/workflows/release.yml) 《Techmino:方块研究所》——Github & Gitee 官方仓库 Official Repository From 658e6f7fdd47bb06e8ae300225014d37e7cda525 Mon Sep 17 00:00:00 2001 From: ParticleG Date: Sun, 24 Oct 2021 22:06:30 +0800 Subject: [PATCH 4/8] - Pass version number to fastlane --- .github/actions/build-ios/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-ios/action.yml b/.github/actions/build-ios/action.yml index 58084d8b..608d7a70 100644 --- a/.github/actions/build-ios/action.yml +++ b/.github/actions/build-ios/action.yml @@ -66,7 +66,6 @@ runs: mv Techmino.love Techmino-iOS/platform/xcode mv libcold_clear.a Techmino-iOS/platform/xcode mv libCCloader.a Techmino-iOS/platform/xcode - python3 .github/workflows/updateVersion.py -T iOS -N ${{ inputs.name }} - name: Run fastlane uses: maierj/fastlane-action@v2.0.1 with: @@ -81,6 +80,7 @@ runs: APP_ID: '${{ inputs.APPLE_APP_ID }}' APP_IDENTIFIER: '${{ inputs.APPLE_APP_IDENTIFIER }}' APP_PROFILE: '${{ inputs.APPLE_APP_PROFILE }}' + APP_VERSION: '${{ inputs.name }}' DEVELOPER_ACCOUNT: '${{ inputs.APPLE_DEVELOPER_ACCOUNT }}' KEYCHAIN_NAME: '${{ inputs.APPLE_KEYCHAIN_NAME }}' KEYCHAIN_PWD: '${{ inputs.APPLE_KEYCHAIN_PWD }}' From 0f570be7e5ade0253a8bfe1c84cc142881b57090 Mon Sep 17 00:00:00 2001 From: ParticleG Date: Sun, 24 Oct 2021 23:54:16 +0800 Subject: [PATCH 5/8] - Modify build number --- .github/workflows/dev.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 8c9df6a9..e9f33e7c 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -130,7 +130,7 @@ jobs: APPLE_API_ID: '${{ secrets.APPLE_API_ID }}' APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_number }}' + APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_id }}.${{ github.run_attempt }}' APPLE_APP_CHANGELOG: '${{ github.event.commits[0].message }}' APPLE_APP_ID: '${{ secrets.APPLE_APP_ID }}' APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ed3e21c..c6ed5289 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -190,7 +190,7 @@ jobs: APPLE_API_ID: '${{ secrets.APPLE_API_ID }}' APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_number }}' + APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_id }}.${{ github.run_attempt }}' APPLE_APP_CHANGELOG: '${{ github.event.commits[0].message }}' APPLE_APP_ID: '${{ secrets.APPLE_APP_ID }}' APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a6e36688..85469651 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,7 +132,7 @@ jobs: APPLE_API_ID: '${{ secrets.APPLE_API_ID }}' APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_number }}' + APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_id }}.${{ github.run_attempt }}' APPLE_APP_CHANGELOG: '${{ github.event.commits[0].message }}' APPLE_APP_ID: '${{ secrets.APPLE_APP_ID }}' APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}' From 50d73bcc1e3e78a5498cf6d748acc9e918f1a53c Mon Sep 17 00:00:00 2001 From: ParticleG Date: Mon, 25 Oct 2021 00:28:41 +0800 Subject: [PATCH 6/8] - Try more dots --- .github/workflows/dev.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index e9f33e7c..150dda98 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -130,7 +130,7 @@ jobs: APPLE_API_ID: '${{ secrets.APPLE_API_ID }}' APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_id }}.${{ github.run_attempt }}' + APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.0.${{ github.run_number }}.${{ github.run_attempt }}' APPLE_APP_CHANGELOG: '${{ github.event.commits[0].message }}' APPLE_APP_ID: '${{ secrets.APPLE_APP_ID }}' APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6ed5289..f76e4f45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -190,7 +190,7 @@ jobs: APPLE_API_ID: '${{ secrets.APPLE_API_ID }}' APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_id }}.${{ github.run_attempt }}' + APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.2.${{ github.run_number }}.${{ github.run_attempt }}' APPLE_APP_CHANGELOG: '${{ github.event.commits[0].message }}' APPLE_APP_ID: '${{ secrets.APPLE_APP_ID }}' APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 85469651..120c3e24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,7 +132,7 @@ jobs: APPLE_API_ID: '${{ secrets.APPLE_API_ID }}' APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.${{ github.run_id }}.${{ github.run_attempt }}' + APPLE_APP_BUILD: '${{ needs.get-info.outputs.code }}.1.${{ github.run_number }}.${{ github.run_attempt }}' APPLE_APP_CHANGELOG: '${{ github.event.commits[0].message }}' APPLE_APP_ID: '${{ secrets.APPLE_APP_ID }}' APPLE_APP_IDENTIFIER: '${{ secrets.APPLE_APP_IDENTIFIER }}' From 8d8e537cd4cc00abbf237be8275c1b52e7759dfe Mon Sep 17 00:00:00 2001 From: ParticleG Date: Mon, 25 Oct 2021 14:15:48 +0800 Subject: [PATCH 7/8] - Add send email support --- .github/actions/build-ios/action.yml | 9 ++++++++- .github/workflows/test.yml | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-ios/action.yml b/.github/actions/build-ios/action.yml index 608d7a70..235127d5 100644 --- a/.github/actions/build-ios/action.yml +++ b/.github/actions/build-ios/action.yml @@ -46,7 +46,12 @@ inputs: FASTLANE_MATCH_TOKEN: required: true description: "Fastlane Match Github token" - + FASTLANE_REPORT_EMAIL: + required: false + description: "Fastlane Report email" + FASTLANE_REPORT_PWD: + required: false + description: "Fastlane Report password" runs: using: "composite" steps: @@ -86,6 +91,8 @@ runs: KEYCHAIN_PWD: '${{ inputs.APPLE_KEYCHAIN_PWD }}' MATCH_PASSWORD: '${{ inputs.FASTLANE_MATCH_PWD }}' MATCH_TOKEN: '${{ inputs.FASTLANE_MATCH_TOKEN }}' + FASTLANE_REPORT_EMAIL: '${{ inputs.FASTLANE_REPORT_EMAIL }}' + FASTLANE_REPORT_PWD: '${{ inputs.FASTLANE_REPORT_PWD }}' - name: Move ipa shell: bash run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 120c3e24..9bc3b019 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -142,6 +142,8 @@ jobs: APPLE_KEYCHAIN_PWD: '${{ secrets.APPLE_KEYCHAIN_PWD }}' FASTLANE_MATCH_PWD: '${{ secrets.FASTLANE_MATCH_PWD }}' FASTLANE_MATCH_TOKEN: '${{ secrets.FASTLANE_MATCH_TOKEN }}' + FASTLANE_REPORT_EMAIL: '${{ secrets.FASTLANE_REPORT_EMAIL }}' + FASTLANE_REPORT_PWD: '${{ secrets.FASTLANE_REPORT_PWD }}' - name: Upload uses: actions/upload-artifact@v2 with: From e5fd3f6c9fab301aee6de44c802937e78a4b8a8f Mon Sep 17 00:00:00 2001 From: ParticleG Date: Mon, 25 Oct 2021 15:58:03 +0800 Subject: [PATCH 8/8] - Give up using email to notify --- .github/actions/build-ios/action.yml | 8 -------- .github/workflows/test.yml | 2 -- 2 files changed, 10 deletions(-) diff --git a/.github/actions/build-ios/action.yml b/.github/actions/build-ios/action.yml index 235127d5..6c3ef2cb 100644 --- a/.github/actions/build-ios/action.yml +++ b/.github/actions/build-ios/action.yml @@ -46,12 +46,6 @@ inputs: FASTLANE_MATCH_TOKEN: required: true description: "Fastlane Match Github token" - FASTLANE_REPORT_EMAIL: - required: false - description: "Fastlane Report email" - FASTLANE_REPORT_PWD: - required: false - description: "Fastlane Report password" runs: using: "composite" steps: @@ -91,8 +85,6 @@ runs: KEYCHAIN_PWD: '${{ inputs.APPLE_KEYCHAIN_PWD }}' MATCH_PASSWORD: '${{ inputs.FASTLANE_MATCH_PWD }}' MATCH_TOKEN: '${{ inputs.FASTLANE_MATCH_TOKEN }}' - FASTLANE_REPORT_EMAIL: '${{ inputs.FASTLANE_REPORT_EMAIL }}' - FASTLANE_REPORT_PWD: '${{ inputs.FASTLANE_REPORT_PWD }}' - name: Move ipa shell: bash run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9bc3b019..120c3e24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -142,8 +142,6 @@ jobs: APPLE_KEYCHAIN_PWD: '${{ secrets.APPLE_KEYCHAIN_PWD }}' FASTLANE_MATCH_PWD: '${{ secrets.FASTLANE_MATCH_PWD }}' FASTLANE_MATCH_TOKEN: '${{ secrets.FASTLANE_MATCH_TOKEN }}' - FASTLANE_REPORT_EMAIL: '${{ secrets.FASTLANE_REPORT_EMAIL }}' - FASTLANE_REPORT_PWD: '${{ secrets.FASTLANE_REPORT_PWD }}' - name: Upload uses: actions/upload-artifact@v2 with: