-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (132 loc) · 3.92 KB
/
build.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Git Stream Build and Release
run-name: Git Stream Build and Release - ${{ github.run_id }}
on:
workflow_dispatch:
push:
branches:
- main
- release/*
- feature/*
pull_request:
branches:
- main
- release/*
- feature/*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ARTIFACTS_DIR: artifacts
GH_TOKEN: ${{ github.token }}
VJER_ENV: development
jobs:
test:
uses: tardis4500/shared-actions/.github/workflows/vjer.yml@main
with:
action: test
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version:
- "3.12"
- "3.13"
build:
needs: test
uses: tardis4500/shared-actions/.github/workflows/vjer.yml@main
with:
action: build
os: ubuntu-latest
python-version: "3.12"
use-flit: true
install-test:
needs: build
uses: tardis4500/shared-actions/.github/workflows/install-test.yml@main
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
test-action: "python -c 'import batcave; print(batcave.__version__)'"
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version:
- "3.12"
- "3.13"
pre_release:
needs: install-test
if: (github.event_name != 'pull_request') && ((github.ref_name == 'main') || startsWith(github.ref_name, 'release/'))
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
environment: pre_release
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_TOKEN }}
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Install vjer
run: pip install vjer
- name: Prepare Git
run: |
git config user.name "${{ github.triggering_actor }}"
git config user.email "${{ github.triggering_actor }}@users.noreply.github.com"
git pull
- name: Publish to Test PyPi
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: ${{ env.ARTIFACTS_DIR }}
- name: Run post-publish steps
run: vjer pre_release
release:
needs: pre_release
if: (github.event_name != 'pull_request') && ((github.ref_name == 'main') || startsWith(github.ref_name, 'release/'))
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
environment: release
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_TOKEN }}
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install vjer
run: pip install vjer
- name: Prepare Git
run: |
git config user.name "${{ github.triggering_actor }}"
git config user.email "${{ github.triggering_actor }}@users.noreply.github.com"
git pull
- name: Run post-publish steps
run: vjer release
- name: Publish to PyPi
uses: pypa/[email protected]
with:
packages-dir: ${{ env.ARTIFACTS_DIR }}
- name: Upload released artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACTS_DIR }}-released
path: ${{ env.ARTIFACTS_DIR }}
# cSpell:ignore pypa