-
Notifications
You must be signed in to change notification settings - Fork 4
125 lines (116 loc) · 3.5 KB
/
publish-for-liquibase.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
name: Build For Liquibase
on:
workflow_dispatch:
schedule:
- cron: "5 6 * * *"
push:
branches:
- "main"
workflow_call:
inputs:
version:
required: true
description: "Version to publish"
type: string
repository:
required: true
description: "Repository to check out"
type: string
jobs:
build:
name: Build Extension
uses: liquibase/build-logic/.github/workflows/pro-extension-build-for-liquibase.yml@main
secrets: inherit
with:
os: '["ubuntu-latest", "macos-latest", "windows-latest"]'
java: "[17, 21]"
artifactPath: liquibase-checks
combineJars: true
repository: ${{ inputs.repository }}
version: ${{ inputs.version }}
publish-main-snapshots-to-gpm:
name: Publish to GPM
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: read
packages: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_USERNAME: "liquibot"
GIT_PASSWORD: ${{ secrets.LIQUIBOT_PAT_GPM_ACCESS }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
token: ${{ secrets.BOT_TOKEN }}
- name: Download Multiplatform Artifacts
uses: actions/download-artifact@v4
with:
name: multiplatform-artifacts
path: ./artifacts
- name: Verify renamed files
run: |
ls -l ./artifacts
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
cache: "maven"
#look for dependencies in maven
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v22
with:
repositories: |
[
{
"id": "liquibase",
"url": "https://maven.pkg.github.com/liquibase/liquibase",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
},
{
"id": "liquibase-pro",
"url": "https://maven.pkg.github.com/liquibase/liquibase-pro",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
}
]
servers: |
[
{
"id": "liquibase",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT_GPM_ACCESS }}"
},
{
"id": "liquibase-pro",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT_GPM_ACCESS }}"
}
]
- name: Publish to GitHub Packages
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
mvn deploy:deploy-file \
-Dfile="./artifacts/liquibase-checks-${{ inputs.version }}.jar" \
-DgroupId=org.liquibase.ext \
-DartifactId=liquibase-checks \
-Dversion=${{ inputs.version }} \
-Dpackaging=jar \
-DrepositoryId=liquibase \
-Durl=https://maven.pkg.github.com/${{ inputs.repository }} \
-Dusername=liquibot \
-Dpassword=${{ env.GIT_PASSWORD }}