-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (116 loc) · 4.91 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
name: Release Flex
on:
workflow_dispatch:
inputs:
version:
description: 'Version of Flex'
required: true
manifest:
description: 'URL of Manifest'
required: true
release_number_bump:
description: 'I have updated system.clj release number!'
required: true
default: 'false'
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check that we have bumped release number
run: |
./scripts/release_number_check.sh ${{github.event.inputs.release_number_bump}}
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Download and verify JAR(s)
run: |
./scripts/jar.sh "${{github.event.inputs.manifest}}"
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Configure AWS Credentials (OIDC)
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-east-1
- name: Release Flex JDK11 JAR
run: |
VERSION=${{github.event.inputs.version}}
VERSION="${VERSION//./-}"
aws s3 cp target/flex-java11-standalone.jar s3://${{ secrets.RELEASES_BUCKET }}/flex-$VERSION-java11.jar
- name: Release Flex JDK8 JAR
run: |
VERSION=${{github.event.inputs.version}}
VERSION="${VERSION//./-}"
aws s3 cp target/flex-java8-standalone.jar s3://${{ secrets.RELEASES_BUCKET }}/flex-$VERSION-java8.jar
- name: Release Dependency Check Report
run: |
VERSION=${{github.event.inputs.version}}
VERSION="${VERSION//./-}"
tar xzf flex-enterprise-nvd-report.tar.gz
cd flex-enterprise-nvd-report
mv *.html index.html
aws s3 cp index.html s3://${{ secrets.RELEASES_BUCKET }}/flex-dependency-check-report-$VERSION.html
- name: Log into GitHub packages
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
-
# 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: Build Flex (SE)
run: |
VERSION=${{github.event.inputs.version}}
IMAGE_ID=factorhouse/flex-se
IMAGE_TAG=$VERSION
./scripts/build_all.sh $VERSION $IMAGE_ID $IMAGE_TAG dockerfile/flex/Dockerfile
- name: Build Flex (latest) (SE)
run: |
VERSION=${{github.event.inputs.version}}
IMAGE_ID=factorhouse/flex-se
IMAGE_TAG=latest
./scripts/build_all.sh $VERSION $IMAGE_ID $IMAGE_TAG dockerfile/flex/Dockerfile
- name: Build Flex (SE)
run: |
VERSION=${{github.event.inputs.version}}
IMAGE_ID=factorhouse/flex-ee
IMAGE_TAG=$VERSION
./scripts/build_all.sh $VERSION $IMAGE_ID $IMAGE_TAG dockerfile/flex/Dockerfile
- name: Build Flex (latest) (SE)
run: |
VERSION=${{github.event.inputs.version}}
IMAGE_ID=factorhouse/flex-ee
IMAGE_TAG=latest
./scripts/build_all.sh $VERSION $IMAGE_ID $IMAGE_TAG dockerfile/flex/Dockerfile
- name: Install babashka
run: sudo bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)
- name: Update releases-flex-ee.edn
run: ./scripts/release.clj ${{github.event.inputs.version}} releases-flex-ee.edn
- name: Update dockerhub/flex-ee/README.md
run: echo ${{github.event.inputs.version}} | ./scripts/dockerhub_readme_ee.clj
- name: Update dockerhub/flex-se/README.md
run: echo ${{github.event.inputs.version}} | ./scripts/dockerhub_readme_se.clj
- name: Deploy Manifest to s3
run: |
aws s3 cp docs/releases-flex-ee.edn s3://${{ secrets.RELEASES_BUCKET }}/releases-flex-ee.edn --cache-control no-cache --content-type application/edn
- name: Commit
run: |
git config --global user.email "[email protected]"
git config --global user.name "Flex CI"
git commit -am "Release Enterprise ${{github.event.inputs.version}}"
- name: Tag
run: git tag -a ee/${{github.event.inputs.version}} -m "Release Enterprise ${{github.event.inputs.version}}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}