-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (67 loc) · 2.2 KB
/
build_wheel.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
name: Build Wheel
on:
push:
tags:
- "v*"
jobs:
build:
name: "Build Release"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup buildx instance
uses: docker/setup-buildx-action@v2
with:
use: true
- name: Build
shell: bash
run: |
RELEASE_VERSION=${{ github.ref }}
RELEASE_VERSION="${RELEASE_VERSION#refs/tags/v}"
echo "RELEASE_VERSION=${RELEASE_VERSION}"
PYTHON_VERSION=${{ matrix.python }}
PYTHON_VERSION=${PYTHON_VERSION//./}
echo "PYTHON_VERSION=${PYTHON_VERSION}"
BUILD_IMAGE="ghcr.io/${GITHUB_REPOSITORY,,}/connector_builder:base"
echo "BUILD_IMAGE=${BUILD_IMAGE}"
RELEASE_IMAGE="ghcr.io/${GITHUB_REPOSITORY,,}/connector_builder:${RELEASE_VERSION}"
echo "RELEASE_IMAGE=${RELEASE_IMAGE}"
docker buildx build --build-arg BUILD_IMAGE=${BUILD_IMAGE} --build-arg RELEASE_IMAGE=${RELEASE_IMAGE} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -f .github/workflows/build_wheel/Dockerfile -o dist/ .
ls -l dist/
- name: Upload
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/osstorchconnector*
release:
name: "Tagged Release"
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download builds and release notes
uses: actions/download-artifact@v3
- name: Display downloaded files
shell: bash
run: |
ls -l dist
releasever=${{ github.ref }}
releasever="${releasever#refs/tags/}"
echo "RELEASE_VERSION=${releasever}" >> $GITHUB_ENV
- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
prerelease: false
files: dist/osstorchconnector*