|
1 |
| -name: Build windows x86-64 |
| 1 | +name: Build windows x86-64 and Python AppImage |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches: [ "master" ]
|
6 | 6 |
|
7 | 7 | jobs:
|
8 |
| - build: |
9 |
| - |
| 8 | + buildWindows: |
| 9 | + name: Build windows x86-64 |
10 | 10 | runs-on: windows-latest
|
11 | 11 | strategy:
|
12 | 12 | fail-fast: false
|
13 | 13 |
|
14 | 14 | steps:
|
15 |
| - - uses: actions/checkout@v3 |
| 15 | + - uses: actions/checkout@v4 |
16 | 16 | with:
|
17 | 17 | path: HikariBot
|
18 | 18 | ref: 'master'
|
19 |
| - - name: Set up Python 3.10 |
20 |
| - uses: actions/setup-python@v4 |
21 |
| - with: |
22 |
| - python-version: 3.10 |
23 | 19 | - name: Latest-tag
|
24 | 20 | run: |
|
25 | 21 | cd HikariBot
|
26 | 22 | git tag Latest --force
|
27 | 23 | git push --force origin refs/tags/Latest:refs/tags/Latest
|
28 | 24 | cd ..
|
29 |
| - - name: Prepare phthon environment with conda |
30 |
| - shell: cmd |
31 |
| - run: | |
32 |
| - cd HikariBot |
33 |
| - call %CONDA%/condabin/conda.bat create --prefix .\pyenv python |
34 |
| - call %CONDA%/condabin/conda.bat activate .\pyenv |
35 |
| - python -m pip install --upgrade pip |
36 |
| - python -m pip install nb-cli hikari-bot nonebot2[fastapi] hikari-core |
37 |
| - python -m pip install nonebot-plugin-apscheduler |
38 |
| - python -m pip install nonebot-plugin-gocqhttp |
39 |
| - python -m pip install nonebot-plugin-guild-patch |
40 |
| - set PLAYWRIGHT_BROWSERS_PATH=0 |
41 |
| - python -m playwright install chromium |
42 |
| - call %CONDA%/condabin/conda.bat deactivate |
43 |
| - attrib -h .git |
44 |
| - cd .. |
45 |
| - - name: Pack windows x86-64 version |
46 |
| - shell: pwsh |
47 |
| - run: | |
48 |
| - $tmp = Get-Content "HikariBot\.git\config" |
49 |
| - echo $tmp |Select-String -NotMatch -Pattern "extraheader" | Set-Content "HikariBot\.git\config" |
50 |
| - Compress-Archive -DestinationPath release.zip -Path HikariBot |
51 | 25 | - name: Delete and create latest release
|
52 | 26 | uses: actions/github-script@v6
|
53 | 27 | with:
|
|
60 | 34 | await github.rest.repos.deleteRelease({ owner, repo, release_id: id })
|
61 | 35 | }
|
62 | 36 | const { data: { id } } = await github.rest.repos.createRelease({ owner, repo, tag_name: "Latest", name: "Latest Release" })
|
63 |
| - await github.rest.repos.uploadReleaseAsset({ owner, repo, release_id: id, name: "release_windows.zip", data: await fs.readFile("release.zip") }) |
| 37 | +
|
| 38 | + appimage: |
| 39 | + name: Build python 3.9 AppImage |
| 40 | + needs: buildWindows |
| 41 | + runs-on: ubuntu-20.04 |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + repository: niess/python-appimage |
| 49 | + ref: 'master' |
| 50 | + - name: Build |
| 51 | + env: |
| 52 | + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' |
| 53 | + run: | |
| 54 | + python -m python_appimage build manylinux \ |
| 55 | + 2014_x86_64 cp39-cp39 |
| 56 | + mv python3*.AppImage python3.9-cp39-cp39-manylinux2014_x86_64.AppImage |
| 57 | + |
| 58 | + - name: Upload Appimage |
| 59 | + uses: actions/github-script@v6 |
| 60 | + with: |
| 61 | + script: | |
| 62 | + const fs = require("fs").promises; |
| 63 | + const { owner, repo } = context.repo |
| 64 | + const { data } = await github.rest.repos.listReleases({ owner, repo }) |
| 65 | + if ( data.length > 0){ |
| 66 | + const { data: { id } } = await github.rest.repos.getLatestRelease({ owner, repo }) |
| 67 | + await github.rest.repos.uploadReleaseAsset({ owner, repo, release_id: id, name: "python3.9-cp39-cp39-manylinux2014_x86_64.AppImage", data: await fs.readFile("python3.9-cp39-cp39-manylinux2014_x86_64.AppImage") }) |
| 68 | + } |
0 commit comments