Skip to content

Commit

Permalink
CI: release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
sqzw-x committed Jan 19, 2024
1 parent b6b8e86 commit f258a45
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 114 deletions.
108 changes: 60 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,48 +53,48 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip

- name: Install libraries
if: ${{ matrix.build == 'macos' }}
run: |
# FIX: No package 'gobject-introspection-1.0' found
# https://tutorials.technology/solved_errors/osx-gobject-introspection-1_0-found.html
brew install gobject-introspection
- name: Install dependencies - macOS
if: ${{ matrix.build == 'macos' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements-mac.txt
pip install pyinstaller==5.8.0
- name: Install dependencies - Windows
if: ${{ matrix.build == 'windows' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller==5.8.0
- name: Build macOS app - macOS
if: ${{ matrix.build == 'macos' }}
run: |
chmod +x build-macos.sh
./build-macos.sh
# cd dist
ls -al dist
rm dist/MDCx
# `upload-artifact`会使文件丢失可执行权限。解决思路,先把`dist`打包成zip,再上传
zip -r MDCx.app.zip dist
ls -al
- name: Build Windows app - Windows
if: ${{ matrix.build == 'windows' }}
run: ./build-action
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: ${{ env.PYTHON_VERSION }}
# cache: pip
#
# - name: Install libraries
# if: ${{ matrix.build == 'macos' }}
# run: |
# # FIX: No package 'gobject-introspection-1.0' found
# # https://tutorials.technology/solved_errors/osx-gobject-introspection-1_0-found.html
# brew install gobject-introspection
#
# - name: Install dependencies - macOS
# if: ${{ matrix.build == 'macos' }}
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements-mac.txt
# pip install pyinstaller==5.8.0
#
# - name: Install dependencies - Windows
# if: ${{ matrix.build == 'windows' }}
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# pip install pyinstaller==5.8.0
#
# - name: Build macOS app - macOS
# if: ${{ matrix.build == 'macos' }}
# run: |
# chmod +x build-macos.sh
# ./build-macos.sh
# # cd dist
# ls -al dist
# rm dist/MDCx
# # `upload-artifact`会使文件丢失可执行权限。解决思路,先把`dist`打包成zip,再上传
# zip -r MDCx.app.zip dist
# ls -al
#
# - name: Build Windows app - Windows
# if: ${{ matrix.build == 'windows' }}
# run: ./build-action

# - name: Upload artifact - macOS
# uses: actions/upload-artifact@v3
Expand All @@ -112,18 +112,30 @@ jobs:
# path: |
# .\MDCx


- name: Get changelog
id: get-changelog
if: ${{ matrix.build == 'macos' }}
run: |
log=$(cat changelog.md)
echo "CHANGELOG=$log" >> $GITHUB_ENV
- name: Create Release - macOS
uses: svenstaro/[email protected]
if: ${{ matrix.build == 'macos' }}
with:
asset_name: MDCx-$tag-${{ matrix.build }}-${{ matrix.arch }}.app.zip
file: MDCx.app.zip
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre-') }}
asset_name: macos.sh
file: build-macos.sh
prerelease: true
body: |
${{ steps.get-changelog.outputs.CHANGELOG }}
- name: Create Release - Windows
uses: svenstaro/[email protected]
if: ${{ matrix.build == 'windows' }}
with:
asset_name: MDCx-$tag-${{ matrix.build }}-${{ matrix.arch }}.exe
file: dist/MDCx.exe
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre-') }}
asset_name: windows.ps1
file: build-action.ps1
prerelease: true


40 changes: 0 additions & 40 deletions build-conda.ps1

This file was deleted.

24 changes: 0 additions & 24 deletions build.ps1

This file was deleted.

24 changes: 24 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
time=$(date +"%Y-%m-%d_%H-%M-%S")

FileName="MDCx-$time.exe"
echo "Output File: $FileName"

pyi-makespec -n "$FileName" -F \
-i resources/Img/MDCx.ico \
-w main.py \
-p "./src" \
--add-data "resources;resources" \
--add-data "libs;." \
--hidden-import socks \
--hidden-import urllib3 \
--hidden-import _cffi_backend \
--collect-all curl_cffi

rm -rf dist

pyinstaller "$FileName.spec"

rm -rf build
rm -f "$FileName.spec"

echo 'Done'
24 changes: 24 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## 新增
* test generate changelog
## 修复
* None

<details>
<summary>Full Changelog</summary>

b6b8e86 Ver 120240119
90b0b06 Fix: 识别 GETCHU-XXXX (#46)
4fba1ba Fix: update config after save (#38)
775c060 CI: build for tags
8a0dea5 CI: macos build
f84f2c6 Merge pull request #48 from northsea4/master
11302a2 Merge branch 'sqzw-x:master' into master
c001cb3 Fix: cant del custom website
f7fc1c6 CI: auto build for release
e432ccd fix release
38cb18f build with github actions
fd2a4be Add: github action build.yml
848f07b Fix: custom url
b6e57d4 Fix: airavcc get url list (#38)

</details>
2 changes: 0 additions & 2 deletions changelog.ps1

This file was deleted.

15 changes: 15 additions & 0 deletions changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
tags=$(git tag -l '120*' --sort=-v:refname)
last=$(echo "$tags" | sed -n '2p')
commitlog=$(git log --pretty=format:"%h %s" $last..HEAD)

echo "## 新增
*
## 修复
*
<details>
<summary>Full Changelog</summary>
$commitlog
</details>" > changelog.md # use "" to keep \n in $commitlog

0 comments on commit f258a45

Please sign in to comment.