-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alan Yeh <[email protected]>
- Loading branch information
Showing
3 changed files
with
279 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
<servers> | ||
<server> | ||
<id>centralx</id> | ||
<username>${env.MAVEN_USERNAME}</username> | ||
<password>${env.MAVEN_PASSWORD}</password> | ||
</server> | ||
<server> | ||
<id>sonatype</id> | ||
<username>${env.MAVEN_USERNAME}</username> | ||
<password>${env.MAVEN_PASSWORD}</password> | ||
</server> | ||
<server> | ||
<id>github</id> | ||
<username>${env.MAVEN_USERNAME}</username> | ||
<password>${env.MAVEN_PASSWORD}</password> | ||
</server> | ||
<server> | ||
<id>gpg.passphrase</id> | ||
<passphrase>${env.GPG_PASSPHRASE}</passphrase> | ||
</server> | ||
</servers> | ||
|
||
<profiles> | ||
<profile> | ||
<id>centralx</id> | ||
<repositories> | ||
<repository> | ||
<id>centralx</id> | ||
<name>CentralX Repository</name> | ||
<url>https://mirror.central-x.com/repository/maven-public/</url> | ||
<snapshots> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>centralx</id> | ||
<name>CentralX Repository</name> | ||
<url>https://mirror.central-x.com/repository/maven-public/</url> | ||
<snapshots> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
|
||
<profile> | ||
<id>sonatype</id> | ||
<repositories> | ||
<repository> | ||
<id>sonatype</id> | ||
<name>Sonatype Repository</name> | ||
<url>https://s01.oss.sonatype.org/content/groups/public/</url> | ||
<snapshots> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</repository> | ||
<repository> | ||
<id>central</id> | ||
<name>Maven Central Repository</name> | ||
<url>https://repo1.maven.org/maven2/</url> | ||
<snapshots> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>sonatype</id> | ||
<name>Sonatype Repository</name> | ||
<url>https://s01.oss.sonatype.org/content/groups/public/</url> | ||
<snapshots> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</pluginRepository> | ||
<pluginRepository> | ||
<id>central</id> | ||
<name>Maven Central Repository</name> | ||
<url>https://repo1.maven.org/maven2/</url> | ||
<snapshots> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
|
||
<profile> | ||
<id>github</id> | ||
<repositories> | ||
<repository> | ||
<id>github</id> | ||
<name>GitHub Repository</name> | ||
<url>https://maven.pkg.github.com/central-x/*/</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</repository> | ||
<repository> | ||
<id>central</id> | ||
<name>Maven Central Repository</name> | ||
<url>https://repo1.maven.org/maven2/</url> | ||
<snapshots> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>github</id> | ||
<name>GitHub Repository</name> | ||
<url>https://maven.pkg.github.com/central-x/*/</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</pluginRepository> | ||
<pluginRepository> | ||
<id>central</id> | ||
<name>Maven Central Repository</name> | ||
<url>https://repo1.maven.org/maven2/</url> | ||
<snapshots> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
</profiles> | ||
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Release to Github Packages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- '*.x' | ||
|
||
jobs: | ||
# 构建应用组件并发布到 GitHub Packages | ||
release-to-github-packages: | ||
name: Release to Github Packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up nodejs | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
- name: Cache maven packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Set up java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: zulu | ||
server-id: github | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: GPG_PASSPHRASE | ||
- name: Release packages to GitHub Packages | ||
run: | | ||
# 覆盖 maven settings.xml 文件,添加自定义 profiles | ||
# 先 install maven-studio-parent 到 local repository | ||
# 再安装 central-studio-views 下项目的 npm 依赖 | ||
# 最后再来发布类库 | ||
rm ~/.m2/settings.xml & cp ${{ github.workspace }}/.github/.m2/settings.xml ~/.m2/settings.xml & | ||
mvn -P github --batch-mode clean install -pl :central-studio-parent & | ||
mvn -P github exec:exec@npm-install -pl :central-dashboard-view,:central-identity-view & | ||
mvn -P github --batch-mode clean deploy | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.GHPKG_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.GHPKG_TOKEN }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
# 构建应用组件并发布到 GitHub Packages | ||
release-docker-images: | ||
name: Release Docker Images | ||
runs-on: ubuntu-latest | ||
needs: [release-to-github-packages] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: zulu | ||
server-id: github | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: GPG_PASSPHRASE | ||
- name: Set up Docker(QEMU) | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker(Buildx) | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver-opts: image=moby/buildkit:master | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Login to GitHub Packages | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHPKG_USERNAME }} | ||
password: ${{ secrets.GHPKG_TOKEN }} | ||
- name: Package | ||
run: | | ||
# 覆盖 maven settings.xml 文件,添加自定义 profiles | ||
# 打包应用组件 | ||
rm ~/.m2/settings.xml & cp ${{ github.workspace }}/.github/.m2/settings.xml ~/.m2/settings.xml & | ||
mvn -P github --batch-mode clean package -pl :central-bootstrap | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.GHPKG_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.GHPKG_TOKEN }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
- name: Release images to GitHub Packages | ||
uses: docker/bake-action@v5 | ||
with: | ||
push: true | ||
env: | ||
REGISTRY: ghcr.io | ||
REPOSITORY: central-x |