-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (65 loc) · 2.11 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Release Version
on:
push:
tags:
- "v*"
jobs:
# Publish Python package to PyPI.
publish-to-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ephys-link
permissions:
id-token: write
steps:
- name: 🛎 Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: 🐍 Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
- name: 📦 Install Hatch
uses: pypa/hatch@install
- name: 🔨 Build Package
run: hatch build
- name: 📦 Publish Distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# Build Windows executable and make release.
build-and-release:
name: Build Executable and Release
runs-on: windows-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: 🐍 Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
- name: 📦 Install Hatch
uses: pypa/hatch@install
- name: 📥 Cache Build
uses: actions/cache@v4
with:
path: build
key: build-${{ runner.os }}
- name: 🔨 Build Executable
run: hatch run exe
- name: 🤐 Zip Build Folder
run: Compress-Archive -Path dist/EphysLink-${{ github.ref_name }} -DestinationPath dist/EphysLink-${{ github.ref_name }}.zip
- name: 📦 Make Release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
# FIXME: Use correct name.
artifacts: "dist/EphysLink-${{ github.ref_name }}.zip,dist/EphysLink-${{ github.ref_name }}.exe"
artifactErrorsFailBuild: true
generateReleaseNotes: true
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'c') || contains(github.ref_name, 'd') }}