1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-18 18:07:37 +03:00
EDMarketConnector/.github/workflows/windows-build.yml
Athanasius 531c839d13
windows-build: Specify custom zip to be in the 'root' directory
zip-release does indeed create this in `directory`, so we need to specify
it should be *in* the 'root' directory that we're including *in* the zip file.
2023-01-11 12:46:28 +00:00

100 lines
2.9 KiB
YAML

name: Build EDMC for Windows
on:
push:
tags:
- "Release/*"
workflow_dispatch:
jobs:
variables:
outputs:
sem_ver: ${{ steps.var.outputs.sem_ver }}
runs-on: "ubuntu-latest"
steps:
- name: Setting global variables
uses: actions/github-script@v6
id: var
with:
script: |
core.setOutput('sem_ver', '${{ github.ref_name }}'.replaceAll('Release\/', ''))
windows_build:
needs: [variables]
name: Build EDMC
runs-on: windows-2019
defaults:
run:
shell: powershell
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version-file: '.python-version'
architecture: "x86"
- name: Install python tools
run: |
pip install wheel
pip install -r requirements-dev.txt
- name: Download winsparkle
run: |
Invoke-Webrequest -UseBasicParsing https://github.com/vslavik/winsparkle/releases/download/v0.7.0/WinSparkle-0.7.0.zip -OutFile out.zip
Expand-Archive out.zip
Move-Item 'out\WinSparkle-0.7.0\x64\Release\*' '.\'
- name: Build EDMC
run: |
python Build-exe-and-msi.py
- name: Make zip archive
uses: thedoctor0/zip-release@main
with:
type: 'zip'
directory: '..'
path: 'EDMarketConnector'
filename: 'EDMarketConnector/EDMarketConnector-release-${{ needs.variables.outputs.sem_ver }}.zip'
exclusions: 'EDMarketConnector-release-*.zip dist.win32/* dist.win32 __pycache__/* __pycache__ .editorconfig .flake8 .git* .mypy.ini .pre-commit-config.yaml Build-exe-and-msi.py *.manifest coriolis-data/* coriolis-data/.??* coriolis-data img/* img out/* out out.zip pyproject.toml scripts/* scripts tests/* tests wix/* wix WinSparkle.*'
- name: Upload build files
uses: actions/upload-artifact@v3
with:
name: Built files
path: |
EDMarketConnector_win*.msi
EDMarketConnector-release-*.zip
release:
name: Release new version
runs-on: ubuntu-latest
needs: windows_build
if: "${{ github.event_name != 'workflow_dispatch' }}"
steps:
- name: Download binary
uses: actions/download-artifact@v3
with:
name: Built files
path: ./
- name: Hash files
run: sha256sum EDMarketConnector_win*.msi EDMarketConnector-release*.zip > ./hashes.sum
- name: Create Draft Release
uses: "softprops/action-gh-release@v1"
with:
token: "${{secrets.GITHUB_TOKEN}}"
draft: true
prerelease: true
discussion_category_name: "Announcement"
files: |
./EDMarketConnector_win*.msi
./EDMarketConnector-release-*.zip
./hashes.sum