Windows CI #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Windows CI | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
jobs: | |
build: | |
if: "!github.event.release.prerelease" | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install mingw | |
run: choco install mingw --Version 8.1.0 | |
- name: npm | |
run: | | |
npm ci | |
npm run-script package-win | |
- name: cmake | |
run: | | |
$env:Path = "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin;" + $env:Path | |
git submodule update --init --recursive | |
mkdir bin | |
mkdir bin/release | |
cd bin/release | |
cmake ../.. -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" | |
make -j | |
- name: collect | |
run: | | |
cp -r dist/MajsoulPaipuCrawler-win32-x64 result | |
cp bin/release/PaipuAnalyzer.exe result/ | |
mkdir result/data | |
cp config.json result/ | |
cp PAADData.json result/ | |
cp doc/README.txt result/ | |
cp doc/release-notes.txt result/ | |
cp -r i18n/ result/ | |
mv result MajsoulPaipuAnalyzer-win-x64 | |
- name: archive | |
run: 7z a MajsoulPaipuAnalyzer-win-x64.7z MajsoulPaipuAnalyzer-win-x64 -m0=LZMA2 -mmt | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: MajsoulPaipuAnalyzer-win-x64.7z | |
path: MajsoulPaipuAnalyzer-win-x64.7z | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: PaipuAnalyzer | |
path: bin/release/PaipuAnalyzer.exe | |
- name: Upload to release | |
if: github.event_name != 'workflow_dispatch' | |
run: | | |
echo $GITHUB_EVENT_PATH $GITHUB_REPOSITORY | |
echo $env:GITHUB_EVENT_PATH $env:GITHUB_REPOSITORY | |
cp .github/asset.js . | |
node asset.js ${{ secrets.ACCESS_TOKEN }} $env:GITHUB_EVENT_PATH $env:GITHUB_REPOSITORY MajsoulPaipuAnalyzer-win-x64.7z application/octet_stream |