Skip to content

Commit 03bb9c1

Browse files
committed
test add appimage build
1 parent 8b69e7c commit 03bb9c1

File tree

2 files changed

+39
-32
lines changed

2 files changed

+39
-32
lines changed

Diff for: .github/workflows/windows_x86-64_pack.yml

+36-31
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,27 @@
1-
name: Build windows x86-64
1+
name: Build windows x86-64 and Python AppImage
22

33
on:
44
push:
55
branches: [ "master" ]
66

77
jobs:
8-
build:
9-
8+
buildWindows:
9+
name: Build windows x86-64
1010
runs-on: windows-latest
1111
strategy:
1212
fail-fast: false
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
path: HikariBot
1818
ref: 'master'
19-
- name: Set up Python 3.10
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: 3.10
2319
- name: Latest-tag
2420
run: |
2521
cd HikariBot
2622
git tag Latest --force
2723
git push --force origin refs/tags/Latest:refs/tags/Latest
2824
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
5125
- name: Delete and create latest release
5226
uses: actions/github-script@v6
5327
with:
@@ -60,4 +34,35 @@ jobs:
6034
await github.rest.repos.deleteRelease({ owner, repo, release_id: id })
6135
}
6236
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+
}

Diff for: install.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ get_distribution() {
4040

4141
download_python_appimage() {
4242
#url_python_AppImage=$(wget --quiet https://api.github.com/repos/niess/python-appimage/releases -O- | grep browser_download_url | grep python3.9 | grep manylinux2014_x86_64 | sed 's_^.*"\(https.*\)"$_\1_g' | sed 's/github.com/ghdown.obfs.dev/g')
43-
url_python_AppImage="https://ghdown.obfs.dev/niess/python-appimage/releases/download/python3.9/python3.9.16-cp39-cp39-manylinux2014_x86_64.AppImage"
43+
#url_python_AppImage="https://ghdown.obfs.dev/niess/python-appimage/releases/download/python3.9/python3.9.18-cp39-cp39-manylinux2014_x86_64.AppImage"
44+
url_python_AppImage="https://ghdown.obfs.dev/94Bo/HikariBot/releases/download/Latest/python3.9-cp39-cp39-manylinux2014_x86_64.AppImage"
45+
#TODO add multi url try?
4446
if command_exists curl; then
4547
curl "${url_python_AppImage}" --location --output python.AppImage
4648
else

0 commit comments

Comments
 (0)