-
-
Notifications
You must be signed in to change notification settings - Fork 217
103 lines (88 loc) · 3.42 KB
/
prerelease-alpha.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
name: Release
on:
push:
branches: ["tolgee-3"]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: "${{ secrets.TOLGEE_MACHINE_PAT }}"
- uses: actions/setup-java@v3
with:
java-version: 21
distribution: adopt
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "22.x"
- name: Install node modules
run: npm ci
- name: Run get new version
run: npm run release-dry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: Tolgee Machine
GIT_COMMITTER_NAME: Tolgee Machine
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_EMAIL: [email protected]
- name: Set version property
id: version
run: echo "VERSION=$(test -e .VERSION && echo v$(cat .VERSION))" >> $GITHUB_OUTPUT
- name: BootJar with version
if: ${{ steps.version.outputs.VERSION != '' }}
run: ./gradlew bootJar
env:
VERSION: ${{ steps.version.outputs.VERSION }}
TOLGEE_API_KEY: ${{secrets.TOLGEE_API_KEY}}
TOLGEE_API_URL: ${{secrets.TOLGEE_API_URL}}
- name: Login to docker
if: ${{ steps.version.outputs.VERSION != '' }}
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p "${{ secrets.DOCKERHUB_PASSWORD }}"
- name: Prepare for docker build
if: ${{ steps.version.outputs.VERSION != '' }}
run: ./gradlew dockerPrepare
env:
VERSION: ${{ steps.version.outputs.VERSION }}
TOLGEE_API_KEY: ${{secrets.TOLGEE_API_KEY}}
TOLGEE_API_URL: ${{secrets.TOLGEE_API_URL}}
- name: Create docker image
if: ${{ steps.version.outputs.VERSION != '' }}
run: |
docker buildx create --use
docker buildx build . -t tolgee/tolgee:${{ steps.version.outputs.VERSION }} --platform linux/arm64,linux/amd64 --push
working-directory: build/docker
- name: Pack with webapp
if: ${{ steps.version.outputs.VERSION != '' }}
run: ./gradlew packResources
env:
VERSION: ${{ steps.version.outputs.VERSION }}
TOLGEE_API_KEY: ${{secrets.TOLGEE_API_KEY}}
TOLGEE_API_URL: ${{secrets.TOLGEE_API_URL}}
- name: Run npm release
if: ${{ steps.version.outputs.VERSION != '' }}
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.version.outputs.VERSION }}
GIT_AUTHOR_NAME: Tolgee Machine
GIT_COMMITTER_NAME: Tolgee Machine
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_EMAIL: [email protected]
- name: Deploy testing
if: ${{ steps.version.outputs.VERSION != '' }}
run: |
mkdir -p ~/.kube
echo $KUBERNETES_DO_SERVICE_CONFIG | base64 -d > ~/.kube/config
kubectl exec $(kubectl get pods -l app=testing-migrator -o jsonpath={.items\[0\].metadata.name}) -- /bin/bash -c "MIGRATE_TARGET_IMAGE=tolgee/tolgee:${{ steps.version.outputs.VERSION }} /migrate.sh"
env:
KUBERNETES_DO_SERVICE_CONFIG: ${{secrets.KUBERNETES_DO_SERVICE_CONFIG}}
- uses: actions/upload-artifact@v3
if: always()
with:
name: test
path: |
./e2e/cypress/videos/**/*
./e2e/cypress/screenshots/**/*
./build/reports/**/*