-
Notifications
You must be signed in to change notification settings - Fork 780
101 lines (96 loc) · 2.79 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
96
97
98
99
100
101
name: Release Package
on:
push:
tags:
- v*
jobs:
pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r requirements.txt
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
homebrew:
runs-on: ubuntu-latest
needs:
- pypi
steps:
- name: Update Homebrew formula
uses: 13ph03nix/action-homebrew-bump-formula@v3
with:
token: ${{ secrets.BREW_TOKEN }}
formula: pocsuite3
aur:
runs-on: ubuntu-latest
needs:
- pypi
steps:
- name: Checkout PKGBUILD repo
run: |
echo "$AUR_SSH_KEY" > ~/aur_ssh_key
chmod 600 ~/aur_ssh_key
git config --global core.sshCommand "ssh -i ~/aur_ssh_key -o 'StrictHostKeyChecking=no'"
git clone "aur@aur.archlinux.org:pocsuite3.git" .
env:
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
- name: Update Version
run: |
export VERSION=$(echo $GH_REF | sed 's:refs/tags/v::')
sed -i "s/^pkgver=.*\$/pkgver=${VERSION}/g" PKGBUILD
sed -i "s/^pkgrel=.*\$/pkgrel=1/g" PKGBUILD
env:
GH_REF: ${{ github.ref }}
- name: Update .SRCINFO and checksum
uses: 13ph03nix/archlinux-package-action@v2
with:
flags: ''
namcap: false
updpkgsums: true
srcinfo: true
- name: Commit and push changes
run: |
export VERSION=$(echo $GH_REF | sed 's:refs/tags/v::')
git config --global user.email "abcnsxyz@gmail.com"
git config --global user.name '13ph03nix'
git commit -a -m "Version ${VERSION} (automated version bump)"
git push origin master
env:
GH_REF: ${{ github.ref }}
dockerhub:
runs-on: ubuntu-latest
needs:
- pypi
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
env:
GH_REF: ${{ github.ref }}
run: |
export VERSION=$(echo $GH_REF | sed 's:refs/tags/v::')
docker build --build-arg version=${VERSION} \
--tag pocsuite3/pocsuite3:v${VERSION} \
--tag pocsuite3/pocsuite3:latest \
.
- name: Login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push
run: |
docker push -a pocsuite3/pocsuite3