Skip to content

Commit

Permalink
Merge pull request #53 from equinix-labs/updateAgent
Browse files Browse the repository at this point in the history
Update agent
  • Loading branch information
tutkat authored Oct 3, 2024
2 parents cb64858 + 36dfbb2 commit 119522a
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 4 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: generate-release
# This workflow will generate changelog and release notes.
# Source: https://github.com/terraform-aws-modules/terraform-aws-vpc/blob/master/.github/workflows/release.yml

on:
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Release
uses: cycjimmy/[email protected]
with:
semantic_version: 19.0.5
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SETTINGS_PATH: ${{ github.workspace }}/settings.xml
GIT_AUTHOR_NAME: equinix-labs@auto-commit-workflow
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: equinix-labs@auto-commit-workflow
GIT_COMMITTER_EMAIL: [email protected]
50 changes: 50 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"branches": [
"main"
],
"ci": false,
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/github",
{
"successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
"labels": false,
"releasedLabels": false
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "echo -n '${nextRelease.version}' > version && make generate",
"publishCmd": "export GITHUB_TOKEN='${process.env.GITHUB_TOKEN}'; cd equinix-openapi-fabric && mvn -B package --file pom.xml && mvn deploy -s ${process.env.SETTINGS_PATH} -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/equinix-labs/fabric-java"
}
],
[
"@semantic-release/git",
{
"message": "ci: regenerate code for version ${nextRelease.version}",
"assets": [
"version",
"equinix-openapi-fabric/src",
"equinix-openapi-fabric/README.md",
"equinix-openapi-fabric/build.gradle",
"equinix-openapi-fabric/build.sbt",
"equinix-openapi-fabric/pom.xml",
"equinix-openapi-fabric-tests/pom.xml"
]
}
]
]
}
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ CURRENT_GID := $(shell id -g)

# git repo : equinix fabric-java sdk
GIT_ORG=equinix-labs
GIT_REPO=fabric-java
GIT_REPO=fabric-sdk-java

PACKAGE_VERSION=$(shell cat version)

# Equinix fabric OAS 3.0.0
SPEC_FETCHED_FILE:=spec/oas3.fabric.fetched.json
Expand Down Expand Up @@ -57,6 +59,8 @@ pull:

docker_generate:
${DOCKER_OPENAPI} generate \
--http-user-agent "${GIT_REPO}/${PACKAGE_VERSION}" \
-p artifactVersion=${PACKAGE_VERSION} \
-i /local/${SPEC_PATCHED_FILE} \
-t /local/templates/Java \
-g java \
Expand Down
2 changes: 1 addition & 1 deletion equinix-openapi-fabric-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.equinix</groupId>
<artifactId>openapi-fabric-tests</artifactId>
<name>equinix-openapi-fabric-tests</name>
<version>0.5.0</version>
<version>0.9.0</version>

<parent>
<groupId>com.equinix</groupId>
Expand Down
2 changes: 1 addition & 1 deletion equinix-openapi-fabric/git_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ "$git_user_id" = "" ]; then
fi

if [ "$git_repo_id" = "" ]; then
git_repo_id="fabric-java"
git_repo_id="fabric-sdk-java"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private void init() {
json = new JSON();

// Set default User-Agent.
setUserAgent("OpenAPI-Generator/0.5.0/java");
setUserAgent("fabric-sdk-java/0.9.0");

authentications = new HashMap<String, Authentication>();
}
Expand Down
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.9.0

0 comments on commit 119522a

Please sign in to comment.