-
-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (117 loc) · 3.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# yaml-language-server: $schema=https://json-schema.org/draft-07/schema#
name: Release
on:
push:
tags:
- "v*"
env:
python_version: "3.10"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set node
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python runtime
uses: actions/setup-python@v4
with:
python-version: "${{ env.python_version }}"
- uses: Gr1N/setup-poetry@v8
- name: Install Dependencies
run: |
poetry --version
poetry install
- name: Build
run: |
poetry build
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
release-image:
runs-on: ubuntu-latest
needs: release-pypi
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Tag
id: get-tag
run: |
tag="${{ github.ref_name }}"
echo "before: ${tag}"
prefix="v"
tag=${tag#"${prefix}"}
echo "::set-output name=tag::$(echo $tag)"
echo "after: ${tag}"
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to ALiYun Container Registry
uses: docker/login-action@v3
with:
registry: registry.cn-beijing.aliyuncs.com
username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
password: ${{ secrets.ALIYUN_REGISTRY_TOKEN }}
- id: github_repo_owner_string
uses: ASzc/change-string-case-action@v5
with:
string: ${{ github.repository_owner }}
- name: Build and push
uses: docker/build-push-action@v5
env:
image_name: board-spider-runtime
tag: ${{ steps.get-tag.outputs.tag }}
with:
context: ./
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
docker.io/xcpcio/${{ env.image_name }}:${{ env.tag }}
docker.io/xcpcio/${{ env.image_name }}:latest
ghcr.io/xcpcio/${{ env.image_name }}:${{ env.tag }}
ghcr.io/xcpcio/${{ env.image_name }}:latest
registry.cn-beijing.aliyuncs.com/xcpcio/${{ env.image_name }}:${{ env.tag }}
registry.cn-beijing.aliyuncs.com/xcpcio/${{ env.image_name }}:latest
build-args: |
XCPCIO_BOARD_SPIDER_VERSION=${{ env.tag }}