chore: fix venv guard #48
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
name: Python package | |
on: [push, pull_request] | |
jobs: | |
build-script: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# python-version: ["3.9", "3.10", "3.11"] | |
python-version: ["3.9"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt install automake | |
make create_venv | |
source .venv/bin/activate | |
pip3 install --upgrade pip | |
pip3 install poetry | |
poetry install | |
- name: Dist | |
run: make dist_script | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: derive-script | |
path: dist/ | |
build-linux-exe: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt install automake | |
python3 -m venv .venv | |
source .venv/bin/activate | |
pip3 install --upgrade pip | |
pip3 install ecdsa | |
pip3 install pyinstaller | |
- name: Dist | |
run: make dist_exe | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: derive-linux | |
path: dist/ | |
build-macos-exe: | |
runs-on: macos-11 | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
pip3 install --upgrade pip | |
pip3 install poetry | |
poetry install --with dev | |
- name: Dist | |
run: make dist_exe | |
- name: control | |
run: ls dist/ | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: derive-macos-universal | |
path: dist/ | |
build-windows-exe: | |
runs-on: windows-2019 | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install --with dev | |
pip install pyinstaller | |
- name: Dist | |
run: pyinstaller -F derive.py -n derive-win | |
- name: control | |
run: ls dist/ | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: derive-win.exe | |
path: dist/ | |
release: | |
permissions: | |
id-token: write | |
contents: write | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
needs: | |
- build-script | |
- build-linux-exe | |
- build-macos-exe | |
- build-windows-exe | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: derive-linux | |
path: artifacts/ | |
- uses: actions/download-artifact@v3 | |
with: | |
name: derive-script | |
path: artifacts/ | |
- uses: actions/download-artifact@v3 | |
with: | |
name: derive-macos-universal | |
path: artifacts/ | |
- uses: actions/download-artifact@v3 | |
with: | |
name: derive-win.exe | |
path: artifacts/ | |
# - name: install cosign | |
# uses: sigstore/cosign-installer@main | |
# with: | |
# cosign-release: "v2.0.2" | |
- name: Checksums | |
run: | | |
cd artifacts | |
sha256sum * > SHA256SUMS.txt | |
- uses: sigstore/[email protected] | |
with: | |
inputs: artifacts/* | |
- name: control | |
run: ls artifacts/ | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: artifacts/* |