Merge branch 'main' into pre-release #19
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 Pre Release | |
on: | |
push: | |
branches: [ pre-release ] | |
#env: | |
# tag: ${{ github.run_id }} | |
jobs: | |
set-tag: | |
outputs: | |
tag: ${{steps.set-tag.outputs.tag}} | |
lastTag: ${{steps.last-tag.outputs.lastTag}} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: set-tag | |
run: echo "tag=`date +"%Y%m%d%H%M%S"`" >> $GITHUB_OUTPUT | |
- id: last-tag | |
run: echo "lastTag=$(git tag --sort=-creatordate | sed -n '2p')" >> $GITHUB_OUTPUT | |
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: 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: | |
runs-on: macos-13 | |
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 | |
- 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-$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 }} | |
prerelease: true | |
- name: send telegram message | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TG_GROUP_ID }} | |
token: ${{ secrets.TG_TOKEN }} | |
message: | | |
👇新的预发布版本👇 | |
${{needs.set-tag.outputs.tag}} | |
📦仓库: ${{ github.repository }} | |
See changes: https://github.com/${{ github.repository }}/compare/${{needs.set-tag.outputs.lastTag}}...${{needs.set-tag.outputs.tag}} | |
Download: https://github.com/${{ github.repository }}/releases/tag/${{ needs.set-tag.outputs.tag }} | |
permissions: | |
contents: write |