-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (51 loc) · 1.55 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
on:
push:
branches:
- main
- master
- 'release/**'
pull_request:
branches:
- main
- master
- 'release/**'
permissions:
contents: write
packages: write
id-token: write
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Set Version number
if: github.ref != 'refs/heads/main' && github.event_name == 'push'
run: |
branchId="${GITHUB_REF/refs\/heads\/release\//}"
buildNumber="${branchId}.${GITHUB_RUN_NUMBER}"
echo $branchId $buildNumber
sed "s/0.0.0/${buildNumber}/g" ./localstack_extension/VERSION -i
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# python3 -m pip install --upgrade localstack==2.2.0
make install
# pip3 install -r requirements.txt
- name: Build deployable
run: |
python3 -m pip install build --user
python3 -m build --sdist --wheel --outdir dist/ .
- name: Deploy package to package repository
uses: pypa/gh-action-pypi-publish@release/v1
if: github.ref != 'refs/heads/main' && github.event_name == 'push'
with:
print_hash: true
- name: Tag and release version
if: github.ref != 'refs/heads/main' && github.event_name == 'push'
run: |
git tag ${GITHUB_REF/refs\/heads\/release\//}.$GITHUB_RUN_NUMBER
git push origin ${GITHUB_REF/refs\/heads\/release\//}.$GITHUB_RUN_NUMBER