Skip to content

TV-Multiplatform Build #65

TV-Multiplatform Build

TV-Multiplatform Build #65

Workflow file for this run

name: TV-Multiplatform Build
on:
workflow_dispatch:
# push:
# tags:
# - v*.*.*
jobs:
mod-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 获取最新tag
run: |
latest_tag=$(git describe --tags --abbrev=0)
echo $latest_tag
echo "tag=${latest_tag}" >> $GITHUB_ENV
echo "tag=${latest_tag}" >> $GITHUB_OUTPUT
- name: 打印
run: echo $tag
build-win:
runs-on: windows-latest
needs: mod-version
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'
- run: ls
- run: ./gradlew packageReleaseDistributionForCurrentOS
- run: ./gradlew createReleaseDistributable
- run: ls && tree ./desktopApp /f
- name: compress
shell: pwsh
run: Compress-Archive -Path "./composeApp/build/compose/binaries/main-release/app/TV" -DestinationPath ./TV-win-${{ needs.set-global-var.outputs.tag }}.zip
- name: move result to root
shell: pwsh
run: Move-Item -Path "./composeApp/build/compose/binaries/main-release/app/*.zip" -Destination "./" && Move-Item -Path "./composeApp/build/compose/binaries/main-release/msi/*.msi" -Destination "./"
- run: ls
- uses: actions/upload-artifact@v4
with:
name: win-file
path: |
*.msi
*.zip
build-linux:
runs-on: ubuntu-latest
needs: mod-version
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'
- run: ls
- run: chmod +x ./gradlew && ./gradlew createReleaseDistributable
- run: ./gradlew packageReleaseDistributionForCurrentOS
- run: ls && tree
- name: compress
run: cd ./composeApp/build/compose/binaries/main-release/app && zip -q -r ./TV-linux-${{ needs.set-global-var.outputs.tag }}.zip ./TV
- name: move file
run: mv ./composeApp/build/compose/binaries/main-release/deb/*.deb ./TV-linux-$tag.deb && mv ./composeApp/build/compose/binaries/main-release/app/*.zip ./
- run: ls
- uses: actions/upload-artifact@v4
with:
name: linux-file
path: |
*.deb
*.zip
# https://github.com/JetBrains/compose-multiplatform/blob/master/tutorials/Signing_and_notarization_on_macOS/README.md
build-mac:
needs: mod-version
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'
- run: ls
- run: chmod +x ./gradlew && ./gradlew createReleaseDistributable
- run: ./gradlew packageReleaseDistributionForCurrentOS
- run: ls
- name: compress
run: zip -q -r ./TV-mac-$tag.zip ./composeApp/build/compose/binaries/main-release/app
- name: move file
run: mv ./composeApp/build/compose/binaries/main-release/dmg/*.dmg ./TV-mac-${{ needs.set-global-var.outputs.tag }}.dmg
- run: ls
- uses: actions/upload-artifact@v4
with:
name: mac-file
path: |
*.dmg
*.zip
release:
runs-on: ubuntu-latest
needs: [ build-win, build-linux, build-mac]
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- run: ls && tree
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
**/*.zip
**/*.deb
**/*.pkg
**/*.dmg
**/*.msi
tag_name: $tag
permissions:
contents: write
sendMsg:
name: sendMsg
runs-on: ubuntu-latest
needs:
- release
steps:
- uses: colutius/Telegram-Msg@main
with:
token: ${{ secrets.TG_TOKEN }}
chatid: ${{ secrets.TG_GROUP_ID }}
message: |
👇新的版本👇
📦仓库: ${{ github.repository }}
button: true
button_name: 👀下载👀
button_url: https://github.com/${{ github.repository }}/releases/tag/${{ needs.set-global-var.outputs.tag }}
is_notify: true
is_preview: true