-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (76 loc) · 2.18 KB
/
Copy pathrelease.yml
File metadata and controls
86 lines (76 loc) · 2.18 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
name: release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Existing tag to build & upload binaries for (e.g. v2.1.1)"
required: true
type: string
permissions:
contents: write
jobs:
build:
name: build ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
label: windows-x64
asset: Forge-windows-x64.exe
bin: dist/Forge.exe
- os: ubuntu-latest
label: linux-x64
asset: Forge-linux-x64
bin: dist/Forge
- os: macos-latest
label: macos-arm64
asset: Forge-macos-arm64
bin: dist/Forge
- os: macos-15-intel
label: macos-x64
asset: Forge-macos-x64
bin: dist/Forge
steps:
- name: Determine ref
id: ref
shell: bash
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "ref=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "ref=${{ github.ref }}" >> "$GITHUB_OUTPUT"
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install
run: |
python -m pip install -U pip
pip install -r requirements.txt
pip install -e .
pip install pyinstaller
- name: Build binary
run: pyinstaller --clean --noconfirm forge.spec
- name: Rename asset
shell: bash
run: |
mv "${{ matrix.bin }}" "dist/${{ matrix.asset }}"
ls -la dist/
- name: Upload to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
gh release upload "${{ steps.ref.outputs.tag }}" "dist/${{ matrix.asset }}" \
--repo "${{ github.repository }}" --clobber