-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (86 loc) · 2.77 KB
/
build-release.yml
File metadata and controls
97 lines (86 loc) · 2.77 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
name: Build Release Artifacts
on:
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g., v1.0.0)"
required: true
type: string
prerelease:
description: "Mark GitHub release as prerelease"
required: false
default: "false"
type: choice
options:
- "false"
- "true"
permissions:
contents: write
jobs:
build:
if: github.event_name == 'workflow_dispatch' && github.repository == 'NetSPI/oci-lexer-parser' && github.actor == 'WebbinRoot'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact: oci-lexer-parse-linux-x64
ext: ""
- os: macos-latest
artifact: oci-lexer-parse-macos-x64
ext: ""
- os: windows-latest
artifact: oci-lexer-parse-windows-x64.exe
ext: ".exe"
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 1
# v6.2.0
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install build dependencies
run: |
python -m pip install -U pip
python -m pip install .
python -m pip install pyinstaller
- name: Build binary
run: |
pyinstaller --onefile --name oci-lexer-parse scripts/pyinstaller_entry.py
- name: Rename artifact (Linux/macOS)
if: runner.os != 'Windows'
run: |
mv dist/oci-lexer-parse${{ matrix.ext }} dist/${{ matrix.artifact }}
- name: Rename artifact (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Rename-Item -Path "dist/oci-lexer-parse${{ matrix.ext }}" -NewName "${{ matrix.artifact }}"
- name: Upload artifact
# v7.0.0
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: ${{ matrix.artifact }}
path: dist/${{ matrix.artifact }}
release:
if: github.event_name == 'workflow_dispatch' && github.repository == 'NetSPI/oci-lexer-parser' && github.actor == 'WebbinRoot'
runs-on: ubuntu-latest
needs: build
steps:
# v8.0.1
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
path: dist
- name: Create GitHub release
# v2.6.1
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
with:
tag_name: ${{ inputs.tag }}
name: ${{ inputs.tag }}
prerelease: ${{ inputs.prerelease }}
files: dist/**/*