-
Notifications
You must be signed in to change notification settings - Fork 71
132 lines (132 loc) · 4.57 KB
/
github-action-pre_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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