forked from privacyidea/privacyidea
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (85 loc) · 3.01 KB
/
Copy pathpython-dist.yml
File metadata and controls
91 lines (85 loc) · 3.01 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
# SPDX-FileCopyrightText: (C) 2014 NetKnights GmbH <https://netknights.it>
# SPDX-License-Identifier: CC0-1.0
#
# This workflow will create python packages when the master branch is tagged
name: Python Release
on:
push:
tags:
- 'v*'
permissions:
contents: read
jobs:
build-webui:
name: Build new WebUI artifacts
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
# Build the new WebUI using node.js
- name: Set up Node.js for building the new WebUI
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: lts/* # Use the latest LTS-release
package-manager-cache: false # Disable cache for release builds
- name: Install Node.js dependencies
run: npm ci
working-directory: ./privacyidea/static_new
- name: Build the new WebUI
run: npm run build -- --configuration production
working-directory: ./privacyidea/static_new
- name: Upload WebUI build artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: webui-artifact
path: ./privacyidea/static_new/dist
retention-days: 1
build-dist:
name: Build Python sdist and wheel
permissions:
contents: write # for softprops/action-gh-release to create GitHub release
needs: build-webui
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
# Get the new WebUI from the build artifacts
- name: Get new WebUI build artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: webui-artifact
path: ./privacyidea/static_new/dist
- name: List downloaded artifact
run: ls -R ./privacyidea/static_new/dist
- run: mkdir -p dist
- name: Set up Python 3.13
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.13"
- name: Install build environment
run: >-
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/
- name: Upload packages to artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
path: dist/*
- name: Create GitHub pre-release
id: gh_pre_release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
if: contains(github.ref_name, 'dev')
with:
files: dist/*
prerelease: True
- name: Create GitHub release draft
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
if: steps.gh_pre_release.conclusion == 'skipped'
with:
files: dist/*
draft: True