* change build branch in build.yml * try with get-version * fix get-version * fix get-version again * try use get-version everywhere * use apt upgrade again * fix get-version again * fix get-version again * fix get-version again * fix get-version again * independent get-cc-url * fix get-cc-url * remove 2 useless commands * try action * try fix action * try action * use get-unzip * try windows build * fix build-windows * fix build-love * try build-linux * add shell in build-linux * put `commit id` into `get-version` * fix `updateVersion.py -T Version` * try build-android * add shell into `build-android` * move away android signing from build-android * apply build-android on android mini * gain snapshot action * fixes * fix build-love * use build-macos * put more into build-android * fix build-android * put more into build-macos * fix * fix * ci: use preinstalled ndk (#367) * fix apk location * move `rename` into `build-android` * fix `build-android` * rename variable; remove a level of zips in macOS * shallow clone * remove tons of `./`s * fix icon in windows and linux * reorganize build-android Co-authored-by: 梦飞翔 <1149761294@qq.com>
124 lines
4.3 KiB
YAML
124 lines
4.3 KiB
YAML
name: Techmino CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, ci* ]
|
|
pull_request:
|
|
branches: [ main, ci* ]
|
|
|
|
jobs:
|
|
get-version:
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
name: ${{ steps.actual-get-version.outputs.name }}
|
|
code: ${{ steps.actual-get-version.outputs.code }}
|
|
commit: ${{ steps.actual-get-version.outputs.commit }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install lua
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install lua5.3 -y
|
|
- name: Get Version
|
|
id: actual-get-version
|
|
run: |
|
|
echo "::set-output name=name::$(lua .github/workflows/getVersion.lua -name)"
|
|
echo "::set-output name=code::$(lua .github/workflows/getVersion.lua -code)"
|
|
echo "::set-output name=commit::$(git rev-parse --short ${{ GITHUB.SHA }})"
|
|
|
|
get-cc-url:
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
url: ${{ steps.get-url.outputs.url }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Get URL
|
|
id: get-url
|
|
run: |
|
|
echo "::set-output name=url::https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$(python .github/workflows/getLatest.py -P)"
|
|
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
needs: [get-version, get-cc-url]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: ./.github/actions/snapshot-update
|
|
with:
|
|
commit: ${{ needs.get-version.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
|
|
cc-url: ${{ needs.get-cc-url.outputs.url }}/win64.zip
|
|
version: ${{ needs.get-version.outputs.name }}
|
|
icon: .\.github\build\Windows\icon_snapshot.ico
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: Techmino_${{ needs.get-version.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-version.outputs.commit }}_Windows
|
|
path: love
|
|
|
|
build-linux:
|
|
runs-on: ubuntu-20.04
|
|
needs: [get-version, get-cc-url]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: ./.github/actions/snapshot-update
|
|
with:
|
|
commit: ${{ needs.get-version.outputs.commit }}
|
|
- uses: ./.github/actions/build-linux
|
|
with:
|
|
cc-url: ${{ needs.get-cc-url.outputs.url }}/linux.zip
|
|
icon: .github/build/Linux/icon_snapshot.png
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: Techmino_${{ needs.get-version.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-version.outputs.commit }}_Linux
|
|
path: Techmino.AppImage
|
|
|
|
build-android:
|
|
runs-on: ubuntu-20.04
|
|
needs: [get-version, get-cc-url]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: ./.github/actions/snapshot-update
|
|
with:
|
|
commit: ${{ needs.get-version.outputs.commit }}
|
|
- uses: ./.github/actions/build-android
|
|
with:
|
|
type: Snapshot
|
|
cc-url: ${{ needs.get-cc-url.outputs.url }}
|
|
code: ${{ needs.get-version.outputs.code }}
|
|
name: ${{ needs.get-version.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_${{ needs.get-version.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-version.outputs.commit }}_Android
|
|
path: Techmino_Snapshot.apk
|
|
|
|
build-macOS:
|
|
runs-on: macos-10.15
|
|
needs: [get-version, get-cc-url]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: ./.github/actions/snapshot-update
|
|
with:
|
|
commit: ${{ needs.get-version.outputs.commit }}
|
|
- uses: ./.github/actions/build-macos
|
|
with:
|
|
cc-url: ${{ needs.get-cc-url.outputs.url }}/macOS.zip
|
|
name: ${{ needs.get-version.outputs.name }}
|
|
icon: .github/build/macOS/icon_snapshot.icns
|
|
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
|
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: Techmino_${{ needs.get-version.outputs.name }}_${{ GITHUB.RUN_NUMBER }}_${{ needs.get-version.outputs.commit }}_macOS
|
|
path: Techmino.app
|