Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update agent #53

Merged
merged 13 commits into from
Oct 3, 2024
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/semantic-release-action@v4.0.0
with:
semantic_version: 19.0.5
extra_plugins: |
@semantic-release/exec@6.0.3
@semantic-release/git@10.0.0
conventional-changelog-conventionalcommits@4.6.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SETTINGS_PATH: ${{ github.workspace }}/settings.xml
GIT_AUTHOR_NAME: equinix-labs@auto-commit-workflow
GIT_AUTHOR_EMAIL: bot@equinix.noreply.github.com
GIT_COMMITTER_NAME: equinix-labs@auto-commit-workflow
GIT_COMMITTER_EMAIL: bot@equinix.noreply.github.com
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