Merge pull request #46 from msojocs/45-snap-version

snap跟进更新
This commit is contained in:
msojocs 2022-04-26 11:33:26 +08:00 committed by GitHub
commit 5ce602a8b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 10 deletions

View File

@ -9,7 +9,7 @@ on:
push: push:
tags: tags:
- v* - v*
branches: [ master, dev] branches: [ master, dev, 45-snap-version]
pull_request: pull_request:
branches: [ master ] branches: [ master ]
# # Allows you to run this workflow manually from the Actions tab # # Allows you to run this workflow manually from the Actions tab
@ -328,12 +328,43 @@ jobs:
name: wechat-devtools-${{ matrix.ARCH }}.build name: wechat-devtools-${{ matrix.ARCH }}.build
path: tmp/build path: tmp/build
build-snap:
name: Build Snap Package
runs-on: ubuntu-18.04
timeout-minutes: 30
strategy:
matrix:
ARCH: ['x86_64']
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
with:
use_lxd: true
# You can now run Snapcraft shell commands
- name: Build snap
run: sg lxd -c 'snapcraft --use-lxd'
- name: move file
run: |
mkdir -p tmp/build
mv *.snap tmp/build
- name: Upload artifact
uses: actions/upload-artifact@v2.3.1
with:
# Artifact name
name: wechat-devtools-${{ matrix.ARCH }}.build
path: tmp/build
upload: upload:
name: Create release and upload artifacts name: Create release and upload artifacts
needs: needs:
- build-tar - build-tar
- build-deb - build-deb
# - build-deepin - build-snap
- build-arch - build-arch
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -362,7 +393,7 @@ jobs:
run: | run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage **build/WeChat*.AppImage **build/*.tar.gz **build/*.deb **build/*.pkg.* ./pyuploadtool-x86_64.AppImage **build/WeChat*.AppImage **build/*.tar.gz **build/*.deb **build/*.pkg.* **build/*.snap
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
@ -376,4 +407,5 @@ jobs:
**build/WeChat*.AppImage **build/WeChat*.AppImage
**build/*.tar.gz **build/*.tar.gz
**build/*.deb **build/*.deb
**build/*.pkg.* **build/*.pkg.*
**build/*.snap

View File

@ -11,10 +11,20 @@ VERSION_DATA=(${VERSION_DATA//,/ })
TARGET_VERSION=${VERSION_DATA[0]} TARGET_VERSION=${VERSION_DATA[0]}
TARGET_VERSION_MD5=${VERSION_DATA[1]} TARGET_VERSION_MD5=${VERSION_DATA[1]}
# 获取snapcraft中的版本号 LATEST_TAG=$(git describe --abbrev=0)
SNAP_VERSION=$(find $root_dir/snap -name "snapcraft.yaml" | xargs grep -P "'\d+\.\d+\.\d{5,}" -o)
if [ "$SNAP_VERSION" != "'$TARGET_VERSION" ];then # 检查snapcraft主版本号是否正确
echo "SNAP版本不匹配" SNAP_VERSION=$(find $root_dir/snap -name "snapcraft.yaml" | xargs grep -P "'\d+\.\d+\.\d+-\d+" -o)
if [ "v${SNAP_VERSION//\'/}" != "$LATEST_TAG" ];then
echo "SNAP版本不正确!!!"
echo "SNAP版本: v${SNAP_VERSION//\'/} != 最新TAG: $LATEST_TAG"
exit 1
fi
# 检查snapcraft构建时下载的工具版本号是否正确
SNAP_DEVTOOL_VERSION=$(find $root_dir/snap -name "snapcraft.yaml" | xargs grep -P "=\d+\d+\d{5,}" -o)
if [ "${SNAP_DEVTOOL_VERSION//=/}" != "${TARGET_VERSION//./}" ];then
echo "SNAP工具版本不匹配!!!"
echo "snap下载版本: ${SNAP_DEVTOOL_VERSION//=/} != 目标版本: ${TARGET_VERSION//./}"
exit 1 exit 1
fi fi

View File

@ -32,8 +32,8 @@ parts:
ls -l $SNAPCRAFT_PART_INSTALL ls -l $SNAPCRAFT_PART_INSTALL
package-nw: package-nw:
plugin: dump plugin: dump
source: https://servicewechat.com/wxa-dev-logic/download_redirect?type=x64&from=mpwiki&download_version=1052203070&version_type=1 source: https://servicewechat.com/wxa-dev-logic/download_redirect?type=x64&from=mpwiki&download_version=1052204180&version_type=1
# source: cache/wechat_devtools_1.05.2203070_x64.exe # source: cache/wechat_devtools_1.05.2204180_x64.exe
source-type: 7z source-type: 7z
source-subdir: code source-subdir: code
override-build: | override-build: |