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 804b450c82
windows-build: Custom zip: Reduce exclusions
It *seems* we don't need to specify both a directory and its contents.

Also, hopefully this will fix the:

    Creating zip archive...

    Command Line Error:
    Unknown switch:
    -

which the last run got.  That was where the 'root' directory prefix was
added to all exclusions.  Maybe the commandline got too long ?
2023-01-11 13:19:04 +00:00

108 lines
3.6 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'
# We want an in-zip prefix of `EDMarketConnector/` for all files, so
# we specify that:
# 1. We work from the parent directory
directory: '..'
# 2. The path we're using is the 'root' directory
path: 'EDMarketConnector'
# 3. The .zip file has to be in the 'root' so that upload-artifact
# will process it. Can't use relative paths.
filename: 'EDMarketConnector/EDMarketConnector-release-${{ needs.variables.outputs.sem_ver }}.zip'
# 4. And all the exclusions need to be prefixed with the 'root'
# directory.
exclusions: 'EDMarketConnector/EDMarketConnector-release-*.zip EDMarketConnector/dist.win32 EDMarketConnector/__pycache__/ EDMarketConnector/.editorconfig EDMarketConnector/.flake8 EDMarketConnector/.git* EDMarketConnector/.mypy.ini EDMarketConnector/.pre-commit-config.yaml EDMarketConnector/Build-exe-and-msi.py EDMarketConnector/*.manifest EDMarketConnector/coriolis-data/ EDMarketConnector/img/ EDMarketConnector/out/ EDMarketConnector/out.zip EDMarketConnector/pyproject.toml EDMarketConnector/scripts/ EDMarketConnector/tests/ EDMarketConnector/wix/ EDMarketConnector/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