-
Notifications
You must be signed in to change notification settings - Fork 9
130 lines (122 loc) · 6.32 KB
/
build2.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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build aissemble 2
on:
workflow_dispatch:
inputs:
buildBranch:
description: "Branch you want to build"
required: true
type: string
default: "285-github-actions-deploy-artifacts"
push:
branches: [ "285-github-actions-deploy-artifacts" ]
jobs:
build:
runs-on: arc-runner-set-aissemble
env:
DOCKER_CONFIG: /home/runner/.docker
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.buildBranch }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install required packages
run: |
sudo apt-get update
sudo apt install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl \
git libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev zip unzip \
libpython3.11
- name: Install Python
uses: gabrielfalcao/pyenv-action@v18
with:
default: 3.11.4
- name: Load m2 repository cache # Manually caching .m2 repo as the setup-java caching isn't falling back to older caches
id: cached-m2-repo
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-
- name: Load m2 build cache
id: cached-m2-build
uses: actions/cache@v4
with:
path: ~/.m2/build-cache
key: maven-build-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-build-cache-
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Poetry cache
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
poetry-
- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Install Helm Unittest Plugin
run: |
echo "Updating helm unittest plugin to latest version..."
helm plugin install https://github.com/helm-unittest/helm-unittest.git
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Create Docker Builder Config File
run: sudo touch /etc/buildkitd.toml
# Run build with the gh-build profile
# - name: Create settings.xml
# run: |
# echo "<settings><servers><server><id>ghcr.io</id><username>d-ryan-ashcraft</username><password>${{ secrets.GHCR_IO_TOKEN }}</password></server><server><id>pypix</id><username>${{ secrets.PYPI_USENAME }}</username><password>${{ secrets.PYPI_TOKEN }}</password></server><server><id>pypi</id><username>${{ secrets.TEST_PYPI_USENAME }}</username><password>${{ secrets.TEST_PYPI_TOKEN }}</password></server> </servers></settings>" > $HOME/.m2/settings.xml
- name: Build aiSSEMBLE
run: |
docker login registry-1.docker.io/v1 -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
echo "<settings><servers><server><id>ghcr.io</id><username>d-ryan-ashcraft</username><password>${{ secrets.GHCR_IO_TOKEN }}</password></server><server><id>pypix</id><username>${{ secrets.PYPI_USENAME }}</username><password>${{ secrets.PYPI_TOKEN }}</password></server><server><id>pypi</id><username>${{ secrets.TEST_PYPI_USENAME }}</username><password>${{ secrets.TEST_PYPI_TOKEN }}</password></server> </servers></settings>" > $HOME/.m2/settings.xml
./mvnw -B clean deploy -U -f pom.xml -Pgh-build --settings $HOME/.m2/settings.xml
# ./mvnw -B clean deploy -U -f extensions/extensions-docker -Pgh-build --settings $HOME/.m2/settings.xml
# ./mvnw -B clean install -U --file pom.xml -Pci,integration-test,gh-build
#NB: The following two explicit cache saves are necessary to ensure caches are saved on build failure,
# until https://github.com/actions/cache/issues/1315 is resolved
# - name: Create settings.xml
# run: |
# echo "<settings><servers><server><id>ghcr.io</id><username>d-ryan-ashcraft</username><password>${{ secrets.GHCR_IO_TOKEN }}</password></server><server><id>pypi</id><username>${{ secrets.PYPI_USENAME }}</username><password>${{ secrets.PYPI_TOKEN }}</password></server><server><id>test-pypi</id><username>${{ secrets.TEST_PYPI_USENAME }}</username><password>${{ secrets.TEST_PYPI_TOKEN }}</password></server></servers></settings>" > $HOME/.m2/settings.xml
# - name: Build aiSSEMBLE
# run: |
# docker login registry-1.docker.io/v1 -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
## ./mvnw -B clean deploy -U -f pom.xml -Pgh-build --settings $HOME/.m2/settings.xml
## ./mvnw -B clean deploy -U -f extensions/extensions-docker -Pgh-build --settings $HOME/.m2/settings.xml
# ./mvnw -B clean install -U --file pom.xml -Pgh-build
## ./mvnw -B clean install -U --file pom.xml -Pci,integration-test,gh-build
# #NB: The following two explicit cache saves are necessary to ensure caches are saved on build failure,
# # until https://github.com/actions/cache/issues/1315 is resolved
- name: Save m2 repository cache
id: save-m2-repo
uses: actions/cache/save@v4
if: always()
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
- name: Save m2 build cache
id: save-m2-build
uses: actions/cache/save@v4
if: always()
with:
path: ~/.m2/build-cache
key: maven-build-cache-${{ hashFiles('**/pom.xml') }}