-
Notifications
You must be signed in to change notification settings - Fork 4
143 lines (126 loc) · 5.41 KB
/
post-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
141
142
143
name: Docker image build CI - build docker image.
on:
release:
types: [ published ]
jobs:
build-docker-image:
name: Build and push SDK semver release docker images
runs-on: ubuntu-22.04
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
# Multi-platform set up.
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# https://github.com/docker/build-push-action
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: ./infrastructure/sdk.Dockerfile
platforms: linux/amd64, linux/arm64
push: true
tags: spryker/php-sdk:${{ github.event.release.tag_name }},spryker/php-sdk:latest
labels: Release ${{ github.event.release.tag_name }}
build-sprykerci-image:
name: Build and push docker image for SprykerCI PHP ${{ matrix.php_version }}
runs-on: ubuntu-22.04
needs: build-docker-image
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# https://github.com/docker/build-push-action
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: ./infrastructure/sdk.sprykerci-${{ matrix.php_version }}.Dockerfile
platforms: linux/amd64
push: true
tags: spryker/php-sdk:sprykerci-${{ matrix.php_version }}
labels: SprykerCI
build-sprykerci-default-image:
name: Build and push docker image for SprykerCI PHP 8.1
runs-on: ubuntu-22.04
needs: build-docker-image
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# https://github.com/docker/build-push-action
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: ./infrastructure/sdk.sprykerci-8.1.Dockerfile
platforms: linux/amd64
push: true
tags: spryker/php-sdk:sprykerci
labels: SprykerCI
installer:
name: Create and publish Spryker SDK installer
runs-on: ubuntu-22.04
needs: build-docker-image
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
# Get details of the latest release.
- name: Get latest release
id: latest_release
uses: kaliber5/action-get-release@v1
with:
token: ${{ github.token }}
latest: true
# Build `installer.sh` script. The result script will be placed into `./build` directory.
- name: Run installer creation
shell: bash
run: |
./infrastructure/installer_builder.sh ${{ github.event.release.tag_name }}
# Uploads `installer.sh` script. Requires `upload_url` from the `latest_release` step.
- name: Upload installer.sh
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.latest_release.outputs.upload_url }}
asset_path: ./build/installer.sh
asset_name: installer.sh
asset_content_type: text/x-shellscript
trigger-sprykerci:
name: Triggers SprykerCI post-release pipeline
runs-on: ubuntu-22.04
needs: [ build-sprykerci-image, build-sprykerci-default-image, installer ]
steps:
- name: Trigger CI pipeline
shell: bash
run: |
curl -X POST https://eu.buddy.works/paas-demo/sdk/pipelines/pipeline/181690/trigger-webhook?token=${{ secrets.EXTERNAL_CI_HOOK_TOKEN }}