-
Notifications
You must be signed in to change notification settings - Fork 503
95 lines (84 loc) · 2.41 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
85
86
87
88
89
90
91
92
93
94
95
name: Publish release
on:
workflow_dispatch:
inputs:
major:
description: 'Major'
required: true
type: number
minor:
description: 'Minor'
required: true
type: number
patch:
description: 'Patch'
required: true
type: number
tag:
description: 'Tag'
required: false
type: string
prerelease:
description: 'Prerelease'
required: true
type: boolean
jobs:
build:
runs-on: windows-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
strategy:
matrix:
platform: ["x64", "ARM64"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Conan
run: pip install conan
- name: Load Conan cache
uses: actions/cache@v4
with:
path: ~/.conan2/p
key: Conan-${{ hashFiles('src/**/conanfile.txt') }}-${{ matrix.platform }}
- name: Generate tag
id: tag
run: |
$tag = "${{ inputs.tag }}" -eq "" ? "v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" : "${{ inputs.tag }}"
echo "tag=$tag" >> $env:GITHUB_OUTPUT
- name: Build
run: python publish.py ${{ matrix.platform }} unpackaged certs\Magpie.pfx "${{ secrets.MAGPIE_PFX_PASSWORD }}"
env:
MAJOR: ${{ inputs.major }}
MINOR: ${{ inputs.minor }}
PATCH: ${{ inputs.patch }}
TAG: ${{ steps.tag.outputs.tag }}
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: Magpie-${{ steps.tag.outputs.tag }}-${{ matrix.platform }}
path: publish/${{ matrix.platform }}
release:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Requests
run: pip install requests
- name: Restore artifacts
uses: actions/download-artifact@v4
with:
path: publish
- name: Publish release
run: python ci/release.py
env:
MAJOR: ${{ inputs.major }}
MINOR: ${{ inputs.minor }}
PATCH: ${{ inputs.patch }}
TAG: ${{ needs.build.outputs.tag }}
PRERELEASE: ${{ inputs.prerelease }}
ACCESS_TOKEN: ${{ secrets.CONTENTS_ACCESS_TOKEN }}