-
Notifications
You must be signed in to change notification settings - Fork 5
107 lines (97 loc) · 3.41 KB
/
package-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
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
name: Publish to PyPi, AUR
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: read
jobs:
deploy_pypi:
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build -s
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Sleep for 15 minutes
run: sleep 900s
shell: bash
deploy_aur:
runs-on: ubuntu-latest
environment: prod
needs: deploy_pypi
steps:
- uses: actions/checkout@v3
- name: Create PKGBUILD dir
run: mkdir -p ./pkg/
- name: Build PKGBUILD
run: sed "s/pkgver=VERSION/pkgver=$(cat pyproject.toml | grep -E 'version = "[0-9\.]+"' -o | grep -E "[0-9\.]+" -o)/" PKGBUILD > ./pkg/PKGBUILD
- name: Publish AUR package
uses: KSXGitHub/[email protected]
with:
pkgname: adjustor
pkgbuild: ./pkg/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: update to '${{ github.event.release.name }}'
allow_empty_commits: false
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
deploy_copr:
runs-on: ubuntu-latest
environment: prod
needs: deploy_pypi
steps:
- uses: actions/checkout@v3
- name: Create spec file dir
run: mkdir -p ./pkg/
- name: Build spec file
run: sed "s/REPLACE_VERSION/$(cat pyproject.toml | grep -E 'version = "[0-9\.]+"' -o | grep -E "[0-9\.]+" -o)/" adjustor.spec > ./pkg/adjustor.spec
- name: Publish to COPR repo
uses: s0/git-publish-subdir-action@develop
env:
REPO: [email protected]:hhd-dev/adjustor-copr.git
BRANCH: main
FOLDER: pkg
SSH_PRIVATE_KEY: ${{ secrets.COPR_SSH_PRIVATE_KEY }}
MESSAGE: update to '${{ github.event.release.name }}'
SKIP_EMPTY_COMMITS: true
# Do not clear any files
CLEAR_GLOBS_FILE: .github/workflows/copr_glob.txt
deploy_nobara:
runs-on: ubuntu-latest
environment: prod
needs: deploy_pypi
steps:
- uses: actions/checkout@v3
- name: Create spec file dir
run: mkdir -p ./pkg/
- name: Build spec file
run: sed "s/REPLACE_VERSION/$(cat pyproject.toml | grep -E 'version = "[0-9\.]+"' -o | grep -E "[0-9\.]+" -o)/" adjustor.spec > ./pkg/adjustor.spec
- name: Rename to Nobara ver
run: >-
sed -i "s/Name: adjustor/Name: hhd-adjustor/" ./pkg/adjustor.spec
- name: Publish to COPR repo
uses: s0/git-publish-subdir-action@develop
env:
REPO: [email protected]:hhd-dev/adjustor-nobara.git
BRANCH: main
FOLDER: pkg
SSH_PRIVATE_KEY: ${{ secrets.NOBARA_SSH_PRIVATE_KEY }}
MESSAGE: update to '${{ github.event.release.name }}'
SKIP_EMPTY_COMMITS: true
# Do not clear any files
CLEAR_GLOBS_FILE: .github/workflows/copr_glob.txt