forked from omegaup/hook_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (61 loc) · 1.93 KB
/
release.yml
File metadata and controls
77 lines (61 loc) · 1.93 KB
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
name: Build containers
on:
push:
branches:
- main
jobs:
bump-version:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: bump-version
uses: anothrNick/github-tag-action@43ed073f5c1445ca8b80d920ce2f8fa550ae4e8d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
INITIAL_VERSION: 1.0.0
outputs:
version: ${{ steps.bump-version.outputs.tag }}
pypi:
runs-on: ubuntu-22.04
needs: bump-version
steps:
- uses: actions/checkout@v2
with:
ref: ${{ needs.bump-version.outputs.version }}
- name: Install Python dependencies
run: python3 -m pip install -r requirements.txt -r requirements.dev.txt
- name: Build wheel
run: python3 -m build
- name: Publish wheel
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
docker:
runs-on: ubuntu-22.04
needs: [bump-version, pypi]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ needs.bump-version.outputs.version }}
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
build-args: |
VERSION=${{ needs.bump-version.outputs.version }}
tags: omegaup/hook_tools:${{ needs.bump-version.outputs.version }}
platforms: linux/amd64,linux/arm64