Skip to content

Commit

Permalink
Merge pull request #24 from CSCfi/feature/windows-release-workflow
Browse files Browse the repository at this point in the history
Feature/windows release workflow
  • Loading branch information
blankdots authored Jul 4, 2023
2 parents 1c03ea1 + 4dc6f94 commit c3d35f2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- "v*"

permissions:
contents: write

jobs:
create_release:
name: Create release
Expand Down Expand Up @@ -70,17 +73,42 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
pip install pyinstaller-versionfile
- name: Build GUI artifact Linux
if: matrix.os == 'ubuntu-latest'
run: |
echo '${{ secrets.DOCKER_PASSWORD }}' | docker login -u '${{ secrets.DOCKER_USERNAME }}' --password-stdin
docker pull cscfi/pyinstaller
docker run --rm -v "${PWD}:/builder" cscfi/pyinstaller --noconsole --onefile crypt4gh_gui.py --name ${{ matrix.asset_name }}
sudo chown -R $USER:$GROUP dist/
- name: Build artifact
if: matrix.os != 'ubuntu-latest'
- name: Build GUI artifact macOS
if: matrix.os == 'macOS-latest'
run: |
pyinstaller --noconsole --onefile crypt4gh_gui.py --name ${{ matrix.asset_name }}
- name: Build GUI artifact windows
if: matrix.os == 'windows-latest'
shell: bash
run: |
TAG=${{ github.ref_name }}
VERSION=${TAG#v}
create-version-file versionfile.yml --outfile file_version_info.txt --version $VERSION
pyinstaller --noconsole --onefile crypt4gh_gui.py --name ${{ matrix.asset_name }} --version-file file_version_info.txt
- name: Create temporary certificate file
if: matrix.os == 'windows-latest'
run: |
cd ${{ github.workspace }}
echo "${{ secrets.CERTIFICATE_BASE64 }}" >> certificate.b64
certutil -decode certificate.b64 certificate.crt
del certificate.b64
- name: Sign windows executable
if: matrix.os == 'windows-latest'
shell: cmd
env:
PASSWORD_ENV: ${{ secrets.CERTIFICATE_PASSWORD }}
run: |
cd ${{ github.workspace }}
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe" sign /f .\certificate.crt /p %PASSWORD_ENV% /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 .\dist\${{ matrix.artifact_name }}
del certificate.crt
- name: Build Asset
run: |
cd ./dist
Expand Down
9 changes: 9 additions & 0 deletions versionfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CompanyName: CSC-Tieteen tietotekniikan keskus Oy
FileDescription: Crypt4gh graphical user interface
InternalName: crypt4gh_gui
LegalCopyright: © CSC-Tieteen tietotekniikan keskus Oy
OriginalFilename: crypt4gh_gui.exe
ProductName: crypt4gh_gui
Translation:
- langID: 1033
charsetID: 1200

0 comments on commit c3d35f2

Please sign in to comment.