Browse Source

Windows CI build

Keir Fraser 4 năm trước cách đây
mục cha
commit
628e90bef6
2 tập tin đã thay đổi với 34 bổ sung9 xóa
  1. 30 6
      .github/workflows/ci.yml
  2. 4 3
      Makefile

+ 30 - 6
.github/workflows/ci.yml

@@ -1,7 +1,7 @@
 name: CI
 on: [push, pull_request]
 jobs:
-  build:
+  build-ubuntu:
     runs-on: ubuntu-20.04
     steps:
     - uses: actions/checkout@v2
@@ -10,19 +10,43 @@ jobs:
         sudo apt update
         sudo apt -y install git gcc-arm-none-eabi python3-pip srecord stm32flash zip
     - name: Dependency packages (pip)
-      run: python3 -m pip install --user bitarray crcmod intelhex
+      run: python3 -m pip install --user bitarray crcmod pyserial
     - name: Build dist
       run: |
         make dist
         mkdir -p _cidist
-        cp Greaseweazle-*.zip _cidist/
+        mv Greaseweazle-*.zip _cidist/
     - name: Build debug dist
       run: |
         env debug=y make dist
-        mkdir -p _cidist/debug
-        cp Greaseweazle-*.zip _cidist/debug/
+        mv Greaseweazle-*.zip _cidist/`echo Greaseweazle-*.zip | sed -e 's/.zip/-debug.zip/'`
     - name: Upload artifacts
       uses: actions/upload-artifact@v2
       with:
-        name: Greaseweazle.${{ github.workflow }}.${{ github.job }}.${{ github.run_number }}.${{ github.run_id }}
+        name: Greaseweazle.CI.${{ github.run_number }}.${{ github.run_id }}
         path: _cidist
+  build-windows:
+    needs: build-ubuntu
+    runs-on: windows-2019
+    steps:
+    - uses: actions/checkout@v2
+    - name: Download Ubuntu build
+      uses: actions/download-artifact@v2
+      with:
+        name: Greaseweazle.CI.${{ github.run_number }}.${{ github.run_id }}
+    - name: Set up Python
+      uses: actions/setup-python@v2
+      with:
+        python-version: 3.8
+    - name: Dependency packages (pip)
+      run: |
+        python -m pip install --upgrade pip setuptools wheel
+        python -m pip install --user bitarray crcmod pyserial cx_Freeze
+    - name: Build dist
+      run: |
+        make windist
+    - name: Upload artifacts
+      uses: actions/upload-artifact@v2
+      with:
+        name: Greaseweazle.CI.${{ github.run_number }}.${{ github.run_id }}
+        path: Greaseweazle-*-win.zip

+ 4 - 3
Makefile

@@ -65,15 +65,16 @@ dist:
 	$(ZIP) $(PROJ)-$(VER).zip $(PROJ)-$(VER)
 
 windist:
-	rm -rf $(PROJ)-* ipf ipf.zip
-	wget https://github.com/keirf/Greaseweazle/releases/download/$(VER)/$(PROJ)-$(VER).zip
+	rm -rf $(PROJ)-$(VER) ipf ipf.zip
+	[ -e $(PROJ)-$(VER).zip ] || \
+	curl -L https://github.com/keirf/Greaseweazle/releases/download/$(VER)/$(PROJ)-$(VER).zip --output $(PROJ)-$(VER).zip
 	$(UNZIP) $(PROJ)-$(VER).zip
 	cp -a scripts/setup.py $(PROJ)-$(VER)/scripts
 	cd $(PROJ)-$(VER)/scripts && $(PYTHON) setup.py build
 	cp -a $(PROJ)-$(VER)/scripts/build/exe.win*/* $(PROJ)-$(VER)/
 	cp -a $(PROJ)-$(VER)/lib/bitarray/VCRUNTIME140.DLL $(PROJ)-$(VER)/
 	rm -rf $(PROJ)-$(VER)/scripts/build $(PROJ)-$(VER)/*.py $(PROJ)-$(VER)/gw
-	wget http://softpres.org/_media/files:spsdeclib_5.1_windows.zip -O ipf.zip
+	curl -L http://softpres.org/_media/files:spsdeclib_5.1_windows.zip --output ipf.zip
 	$(UNZIP) -oipf ipf.zip
 	cp -a ipf/capsimg_binary/CAPSImg.dll $(PROJ)-$(VER)/
 	rm -rf ipf ipf.zip