Skip to content

Commit 730379a

Browse files
committed
feat: CI workflow
1 parent eb66e7b commit 730379a

1 file changed

Lines changed: 26 additions & 45 deletions

File tree

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,29 @@
11
name: Build Postcompiler
22
on:
3-
schedule:
4-
- cron: '14 9 * * TUE' # Run at 9:14 (7:14pm local) on Tuesday
5-
create:
6-
ref_type: 'tag'
73
workflow_dispatch:
8-
# Allow triggering manually whenever it's useful.
94
inputs:
10-
ref:
11-
description: 'Branch/tag/commit to use'
5+
version:
6+
description: 'Release version'
127
required: true
13-
type: string
14-
default: 'dev'
15-
16-
permissions:
17-
contents: read
18-
pull-requests: read
198

209
jobs:
2110
freeze:
2211
strategy:
2312
fail-fast: false
2413
matrix:
2514
include:
26-
# We want 3.8 because it works on Windows 7.
27-
- artifact-name: 'win32'
28-
python-version: '3.8.10'
29-
arch: 'x86'
30-
os: 'windows-latest'
3115
- artifact-name: 'win64'
3216
python-version: '3.11'
3317
arch: 'x64'
3418
os: 'windows-latest'
35-
- artifact-name: 'linux64'
36-
python-version: '3.11'
37-
arch: 'x64'
38-
os: 'ubuntu-latest'
19+
# - artifact-name: 'linux64'
20+
# python-version: '3.11'
21+
# arch: 'x64'
22+
# os: 'ubuntu-latest'
3923
runs-on: ${{ matrix.os }}
40-
name: Build postcompiler-${{ matrix.artifact-name }}
4124
steps:
42-
# Build dev on schedule, since it's actually changing.
43-
- name: Checkout Dev
44-
uses: actions/checkout@v4
45-
if: github.event_name == 'schedule'
46-
with:
47-
ref: dev
48-
# Always build the exact tag that's pushed.
49-
- name: Checkout Tag
50-
uses: actions/checkout@v4
51-
if: github.event_name == 'create'
52-
with:
53-
ref: ${{ github.event.ref }}
54-
- name: Checkout Ref
55-
uses: actions/checkout@v4
56-
if: github.event_name == 'workflow_dispatch'
57-
with:
58-
ref: ${{ inputs.ref }}
59-
25+
- name: Checkout
26+
uses: actions/checkout@v3
6027
- name: Set up Python ${{ matrix.python-version }}-${{ matrix.arch }}
6128
uses: actions/setup-python@v5
6229
with:
@@ -71,17 +38,31 @@ jobs:
7138
- name: Freeze application
7239
run: python -m PyInstaller --distpath ../build/ -y ../postcompiler.spec
7340
working-directory: ./src/
41+
- name: Zip hammeraddons_${{ matrix.artifact-name }}
42+
uses: thedoctor0/zip-release@master
43+
with:
44+
type: 'zip'
45+
directory: ./build/
46+
filename: 'hammeraddons_${{ matrix.artifact-name }}.zip'
7447
- name: Artifact upload (tag)
7548
uses: actions/upload-artifact@v4
7649
if: github.event_name == 'create'
7750
with:
78-
name: hammeraddons_${{ github.event.ref }}_${{ matrix.artifact-name }}
79-
path: ./build/
51+
name: hammeraddons_${{ github.event.inputs.version }}_${{ matrix.artifact-name }}
52+
path: ./build/hammeraddons_${{ matrix.artifact-name }}.zip
8053
if-no-files-found: error
8154
- name: Artifact upload (hash)
8255
uses: actions/upload-artifact@v4
8356
if: github.event_name != 'create'
8457
with:
85-
name: hammeraddons_${{ github.sha }}_${{ matrix.artifact-name }}
86-
path: ./build/
58+
name: hammeraddons_${{ github.event.inputs.version }}_${{ matrix.artifact-name }}
59+
path: ./build/hammeraddons_${{ matrix.artifact-name }}.zip
8760
if-no-files-found: error
61+
62+
- name: Create Release
63+
uses: softprops/action-gh-release@v1
64+
with:
65+
tag_name: ${{ github.event.inputs.version }}
66+
files: |
67+
./build/hammeraddons_${{ matrix.artifact-name }}.zip
68+
fail_on_unmatched_files: true

0 commit comments

Comments
 (0)