-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 1.92 KB
/
publish.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
name: Publish Python package
on:
schedule:
- cron: 0 0 * * 1
workflow_dispatch:
jobs:
version:
outputs:
types: ${{ steps.version.outputs.types }}
tag: ${{ steps.tag.outputs.tag }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: version
run: |
echo "TYPES=$(npm view valorant-api-types --json | jq -r .version)" >> $GITHUB_OUTPUT
- name: Get Previous tag
id: tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: "0.7.0"
build:
needs: version
if: needs.version.outputs.types != needs.version.outputs.tag
uses: ./.github/workflows/deno.yml
publish:
needs: [version, build]
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./template
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Download generated python module
uses: actions/download-artifact@v3
with:
name: python-module
path: template/ValWrap/
- name: Setup python project version
run: |
sed -i "s/^\(version = \).*$/\1\"$next\"/" pyproject.toml
env:
next: ${{ needs.version.outputs.types }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TOKEN }}
packages-dir: template/dist/
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.version.outputs.types }}