-
Notifications
You must be signed in to change notification settings - Fork 109
101 lines (88 loc) · 3.05 KB
/
patch.yml
File metadata and controls
101 lines (88 loc) · 3.05 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
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: Patch
on:
workflow_dispatch:
inputs:
tag:
description: 'Wiremock Docker image tag'
required: true
jobs:
docker-build-push:
runs-on: ubuntu-latest
strategy:
matrix:
versions:
- CONTEXT: .
IMAGES:
- wiremock/wiremock:latest
- wiremock/wiremock:${{ github.event.inputs.tag }}
- ghcr.io/wiremock/wiremock:latest
- ghcr.io/wiremock/wiremock:${{ github.event.inputs.tag }}
PLATFORMS:
- linux/amd64
- linux/arm64
- linux/arm/v7
- CONTEXT: alpine
IMAGES:
- wiremock/wiremock:latest-alpine
- wiremock/wiremock:${{ github.event.inputs.tag }}-alpine
- ghcr.io/wiremock/wiremock:latest-alpine
- ghcr.io/wiremock/wiremock:${{ github.event.inputs.tag }}-alpine
PLATFORMS:
- linux/amd64
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: ${{ matrix.versions.CONTEXT != 'alpine' }}
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout sources
uses: actions/checkout@main
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: wiremockio
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: wiremock
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Wiremock Docker image
uses: docker/build-push-action@v4
with:
context: ${{ matrix.versions.CONTEXT }}
platforms: ${{ join(matrix.versions.PLATFORMS, ',') }}
push: true
tags: ${{ join(matrix.versions.IMAGES, ',') }}
release:
runs-on: ubuntu-latest
needs: docker-build-push
steps:
- name: Checkout sources
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Update version
run: |
LAST_VERSION=$(git describe --tag --abbrev=0)
LAST_MINOR_VERSION=${LAST_VERSION%.*}
NEW_VERSION=${{ github.event.inputs.tag }}
NEW_MINOR_VERSION=${NEW_VERSION%.*}
sed -i s/${LAST_VERSION}/${NEW_VERSION}/g readme.md
sed -i s/${LAST_MINOR_VERSION}/${NEW_MINOR_VERSION}/g readme.md
git config --local user.name "rodolpheche"
git config --local user.email "rodolphe.chaigneau@gmail.com"
git add .
git commit -m "upgrade to version $NEW_VERSION"
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/wiremock/wiremock-docker.git
git push origin main
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag }}