test global env vars
This commit is contained in:
23
.github/workflows/build-and-publish-develop.yml
vendored
23
.github/workflows/build-and-publish-develop.yml
vendored
@@ -7,6 +7,11 @@ on:
|
|||||||
- develop
|
- develop
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
NEXUS_USERNAME: 'edward'
|
||||||
|
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
||||||
|
MAVEN_PUBLIC_REPOSITORY_URL: ${{ secrets.MAVEN_PUBLIC_REPOSITORY_URL }}
|
||||||
|
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
||||||
|
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
||||||
REGISTRY_IMAGE: edeedeeed/ec-config-server
|
REGISTRY_IMAGE: edeedeeed/ec-config-server
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -58,12 +63,6 @@ jobs:
|
|||||||
"password": "${env.NEXUS_PASSWORD}"
|
"password": "${env.NEXUS_PASSWORD}"
|
||||||
}]
|
}]
|
||||||
- name: Maven Publish
|
- name: Maven Publish
|
||||||
env:
|
|
||||||
NEXUS_USERNAME: 'edward'
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
MAVEN_PUBLIC_REPOSITORY_URL: ${{ secrets.MAVEN_PUBLIC_REPOSITORY_URL }}
|
|
||||||
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
run: |
|
run: |
|
||||||
mvn -B deploy -P homelab
|
mvn -B deploy -P homelab
|
||||||
build-docker:
|
build-docker:
|
||||||
@@ -115,12 +114,6 @@ jobs:
|
|||||||
"password": "${env.NEXUS_PASSWORD}"
|
"password": "${env.NEXUS_PASSWORD}"
|
||||||
}]
|
}]
|
||||||
- name: Maven Package
|
- name: Maven Package
|
||||||
env:
|
|
||||||
NEXUS_USERNAME: 'edward'
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
MAVEN_PUBLIC_REPOSITORY_URL: ${{ secrets.MAVEN_PUBLIC_REPOSITORY_URL }}
|
|
||||||
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
run: |
|
run: |
|
||||||
mvn -B package -P homelab
|
mvn -B package -P homelab
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
@@ -204,12 +197,6 @@ jobs:
|
|||||||
}]
|
}]
|
||||||
- name: Extract Maven project version
|
- name: Extract Maven project version
|
||||||
id: project-version
|
id: project-version
|
||||||
env:
|
|
||||||
NEXUS_USERNAME: 'edward'
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
MAVEN_PUBLIC_REPOSITORY_URL: ${{ secrets.MAVEN_PUBLIC_REPOSITORY_URL }}
|
|
||||||
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
run: |
|
run: |
|
||||||
VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout -P homelab)
|
VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout -P homelab)
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|||||||
148
.github/workflows/build-and-publish-release.yml
vendored
148
.github/workflows/build-and-publish-release.yml
vendored
@@ -7,6 +7,11 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
NEXUS_USERNAME: 'edward'
|
||||||
|
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
||||||
|
MAVEN_PUBLIC_REPOSITORY_URL: ${{ secrets.MAVEN_PUBLIC_REPOSITORY_URL }}
|
||||||
|
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
||||||
|
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
||||||
REGISTRY_IMAGE: edeedeeed/ec-config-server
|
REGISTRY_IMAGE: edeedeeed/ec-config-server
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -22,46 +27,59 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-java@v4.2.2
|
- uses: actions/setup-java@v4.2.2
|
||||||
|
if: ${{ hashFiles('**/pom.xml') }}
|
||||||
with:
|
with:
|
||||||
distribution: zulu
|
|
||||||
java-version: 17
|
java-version: 17
|
||||||
|
distribution: zulu
|
||||||
|
cache: 'maven'
|
||||||
|
- name: maven-settings-xml-action
|
||||||
|
uses: whelk-io/maven-settings-xml-action@v22
|
||||||
|
with:
|
||||||
|
profiles: >
|
||||||
|
[{
|
||||||
|
"id": "homelab",
|
||||||
|
"properties": {
|
||||||
|
"altSnapshotDeploymentRepository": "nexus-snapshot::${env.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL}",
|
||||||
|
"altReleaseDeploymentRepository": "nexus-release::${env.RELEASE_DEPLOYMENT_REPOSITORY_URL}"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
repositories: >
|
||||||
|
[{
|
||||||
|
"id": "maven-public",
|
||||||
|
"url": "${env.MAVEN_PUBLIC_REPOSITORY_URL}",
|
||||||
|
"snapshots": {
|
||||||
|
"enabled": "true"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
servers: >
|
||||||
|
[{
|
||||||
|
"id": "nexus-snapshot",
|
||||||
|
"username": "${env.NEXUS_USERNAME}",
|
||||||
|
"password": "${env.NEXUS_PASSWORD}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nexus-release",
|
||||||
|
"username": "${env.NEXUS_USERNAME}",
|
||||||
|
"password": "${env.NEXUS_PASSWORD}"
|
||||||
|
}]
|
||||||
- name: Config Git
|
- name: Config Git
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "edward@cheng.sydney"
|
git config --global user.email "edward@cheng.sydney"
|
||||||
git config --global user.name "3dwardch3ng"
|
git config --global user.name "3dwardch3ng"
|
||||||
git config --global core.autocrlf input
|
git config --global core.autocrlf input
|
||||||
- name: Start release
|
- name: Start release
|
||||||
env:
|
|
||||||
NEXUS_USERNAME: 'edward'
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
run: |
|
run: |
|
||||||
mvn -X gitflow:release-start -B -DpushRemote=true -DallowSnapshots=true \
|
mvn -X gitflow:release-start -B -DpushRemote=true -DallowSnapshots=true \
|
||||||
-P homelab \
|
-P homelab
|
||||||
--settings=${{ github.workspace }}/.mvn/settings.xml
|
|
||||||
- name: Maven Publish
|
- name: Maven Publish
|
||||||
env:
|
|
||||||
NEXUS_USERNAME: 'edward'
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
run: |
|
run: |
|
||||||
mvn -B deploy \
|
mvn -B deploy -P homelab
|
||||||
-P homelab \
|
|
||||||
--settings=${{ github.workspace }}/.mvn/settings.xml
|
|
||||||
- name: Finish release
|
- name: Finish release
|
||||||
env:
|
env:
|
||||||
GITHUB_ACTOR: 3dwardch3ng
|
GITHUB_ACTOR: 3dwardch3ng
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
NEXUS_USERNAME: 'edward'
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
run: |
|
run: |
|
||||||
mvn -X gitflow:release-finish -B -DpushRemote=true -DallowSnapshots=true \
|
mvn -X gitflow:release-finish -B -DpushRemote=true -DallowSnapshots=true -P homelab
|
||||||
-P homelab \
|
|
||||||
--settings=${{ github.workspace }}/.mvn/settings.xml
|
|
||||||
build-docker:
|
build-docker:
|
||||||
if: false
|
if: false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -76,19 +94,44 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-java@v4.2.2
|
- uses: actions/setup-java@v4.2.2
|
||||||
|
if: ${{ hashFiles('**/pom.xml') }}
|
||||||
with:
|
with:
|
||||||
distribution: zulu
|
|
||||||
java-version: 17
|
java-version: 17
|
||||||
|
distribution: zulu
|
||||||
|
cache: 'maven'
|
||||||
|
- name: maven-settings-xml-action
|
||||||
|
uses: whelk-io/maven-settings-xml-action@v22
|
||||||
|
with:
|
||||||
|
profiles: >
|
||||||
|
[{
|
||||||
|
"id": "homelab",
|
||||||
|
"properties": {
|
||||||
|
"altSnapshotDeploymentRepository": "nexus-snapshot::${env.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL}",
|
||||||
|
"altReleaseDeploymentRepository": "nexus-release::${env.RELEASE_DEPLOYMENT_REPOSITORY_URL}"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
repositories: >
|
||||||
|
[{
|
||||||
|
"id": "maven-public",
|
||||||
|
"url": "${env.MAVEN_PUBLIC_REPOSITORY_URL}",
|
||||||
|
"snapshots": {
|
||||||
|
"enabled": "true"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
servers: >
|
||||||
|
[{
|
||||||
|
"id": "nexus-snapshot",
|
||||||
|
"username": "${env.NEXUS_USERNAME}",
|
||||||
|
"password": "${env.NEXUS_PASSWORD}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nexus-release",
|
||||||
|
"username": "${env.NEXUS_USERNAME}",
|
||||||
|
"password": "${env.NEXUS_PASSWORD}"
|
||||||
|
}]
|
||||||
- name: Maven Package
|
- name: Maven Package
|
||||||
env:
|
|
||||||
NEXUS_USERNAME: 'edward'
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
run: |
|
run: |
|
||||||
mvn -B package \
|
mvn -B package -P homelab
|
||||||
-P homelab \
|
|
||||||
--settings=${{ github.workspace }}/.mvn/settings.xml
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
platform=${{ matrix.platform }}
|
platform=${{ matrix.platform }}
|
||||||
@@ -137,18 +180,45 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-java@v4.2.2
|
- uses: actions/setup-java@v4.2.2
|
||||||
|
if: ${{ hashFiles('**/pom.xml') }}
|
||||||
with:
|
with:
|
||||||
distribution: zulu
|
|
||||||
java-version: 17
|
java-version: 17
|
||||||
|
distribution: zulu
|
||||||
|
cache: 'maven'
|
||||||
|
- name: maven-settings-xml-action
|
||||||
|
uses: whelk-io/maven-settings-xml-action@v22
|
||||||
|
with:
|
||||||
|
profiles: >
|
||||||
|
[{
|
||||||
|
"id": "homelab",
|
||||||
|
"properties": {
|
||||||
|
"altSnapshotDeploymentRepository": "nexus-snapshot::${env.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL}",
|
||||||
|
"altReleaseDeploymentRepository": "nexus-release::${env.RELEASE_DEPLOYMENT_REPOSITORY_URL}"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
repositories: >
|
||||||
|
[{
|
||||||
|
"id": "maven-public",
|
||||||
|
"url": "${env.MAVEN_PUBLIC_REPOSITORY_URL}",
|
||||||
|
"snapshots": {
|
||||||
|
"enabled": "true"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
servers: >
|
||||||
|
[{
|
||||||
|
"id": "nexus-snapshot",
|
||||||
|
"username": "${env.NEXUS_USERNAME}",
|
||||||
|
"password": "${env.NEXUS_PASSWORD}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nexus-release",
|
||||||
|
"username": "${env.NEXUS_USERNAME}",
|
||||||
|
"password": "${env.NEXUS_PASSWORD}"
|
||||||
|
}]
|
||||||
- name: Extract Maven project version
|
- name: Extract Maven project version
|
||||||
id: project-version
|
id: project-version
|
||||||
env:
|
|
||||||
NEXUS_USERNAME: 'edward'
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
|
||||||
run: |
|
run: |
|
||||||
VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout -P homelab --settings=${{ github.workspace }}/.mvn/settings.xml)
|
VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout -P homelab)
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
- name: Show extracted Maven project version
|
- name: Show extracted Maven project version
|
||||||
run: echo ${{ steps.project-version.outputs.version }}
|
run: echo ${{ steps.project-version.outputs.version }}
|
||||||
|
|||||||
Reference in New Issue
Block a user