-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (107 loc) · 3.61 KB
/
release.yml
File metadata and controls
126 lines (107 loc) · 3.61 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Release Pyder (New Version)
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., `0.1.0-alpha.1`, `0.1.0-beta.1`, `0.1.0`.)'
required: true
prerelease:
description: 'Mark as prerelease?'
type: boolean
default: false
permissions:
contents: write
env:
pythonVersion: 3.14.3
jobs:
release:
name: Build for ${{ matrix.os-name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
os-name: Linux Ubuntu
artifact-path: dist/Pyder-Linux
artifact-name: Pyder-Linux
- os: windows-latest
os-name: Windows
artifact-path: dist/Pyder-Windows.exe
artifact-name: Pyder-Windows
- os: macos-latest
os-name: macOS
artifact-path: dist/Pyder-macOS
artifact-name: Pyder-macOS
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ env.pythonVersion }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.pythonVersion }}
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Compile with PyInstaller
run: pyinstaller build.spec
- name: Rename Build (Windows)
if: runner.os == 'Windows'
run: move dist\Pyder.exe ${{ matrix.artifact-path }}
- name: Rename Build (Linux/macOS)
if: runner.os != 'Windows'
run: mv dist/Pyder ${{ matrix.artifact-path }}
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ${{ matrix.artifact-path }}
finalize:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Generate commit list
id: commits
run: |
git fetch --tags
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -z "$LAST_TAG" ]; then
COMMITS=$(git log --pretty=format:"- %s (%h)")
else
COMMITS=$(git log ${LAST_TAG}..HEAD --pretty=format:"- %s (%h)")
fi
{
echo "COMMITS<<END"
echo "$COMMITS"
echo "END"
} >> $GITHUB_OUTPUT
- name: Create Git Tag (if not exists) # this is p smart actually
run: |
git fetch --tags
if git rev-parse "${{ inputs.version }}" >/dev/null 2>&1; then
echo "Tag already exists"
else
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag -a ${{ inputs.version }} -m "Release ${{ inputs.version }}"
git push origin ${{ inputs.version }}
fi
- name: Create Release
uses: softprops/action-gh-release@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ inputs.version }}
prerelease: ${{ inputs.prerelease }}
title: 'Pyder: ${{ inputs.version }}'
body: |
# Pyder version ${{ inputs.version }}!!!
Check out the summarized updates in [CHANGELOG.md](https://github.com/PinpointTools/Pyder/blob/main/CHANGELOG.md)
---
## Commits
${{ steps.commits.outputs.COMMITS }}
files: artifacts/neutralino-binaries/**