TV-Multiplatform Build #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TV-Multiplatform Build | |
on: | |
workflow_dispatch: | |
# push: | |
# tags: | |
# - v*.*.* | |
jobs: | |
set-tag: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.get-tag.outputs.tag}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: get-tag | |
id: get-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 && echo "${{ steps.get-tag.outputs.tag}}" | |
build-win: | |
runs-on: windows-latest | |
needs: set-tag | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'gradle' | |
- run: echo ${{needs.set-tag.outputs.tag}} | |
- 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-tag.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: set-tag | |
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-tag.outputs.tag }}.zip ./TV | |
- name: move file | |
run: mv ./composeApp/build/compose/binaries/main-release/deb/*.deb ./TV-linux-${{ needs.set-tag.outputs.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: set-tag | |
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-${{ needs.set-tag.outputs.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-tag.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, set-tag] | |
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: ${{ needs.set-tag.outputs.tag }} | |
permissions: | |
contents: write | |
sendMsg: | |
name: sendMsg | |
runs-on: [ubuntu-latest] | |
needs: | |
- release | |
- set-tag | |
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-tag.outputs.tag }} | |
is_notify: true | |
is_preview: true |