Skip to content

Commit

Permalink
Migrate from Bintray to JFrog for publishing artifacts
Browse files Browse the repository at this point in the history
Changelist:
1. Bintray is deprecated and will no longer work as an artifact management service. This commit replaces Bintray-related workflows and settings with JFrog.
2. Change the id for maven jar plugin's execution so that the test JAR doesn't get published twice.
  • Loading branch information
narendly committed Apr 23, 2021
1 parent 7839435 commit a5f3e48
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 63 deletions.
File renamed without changes.
49 changes: 49 additions & 0 deletions .github/workflows/ci-jfrog-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
## Licensed to the Apache Software Foundation (ASF) under one
## or more contributor license agreements. See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership. The ASF licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing,
## software distributed under the License is distributed on an
## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
## KIND, either express or implied. See the License for the
## specific language governing permissions and limitations
## under the License.
##
name: Publish to LinkedIn JFrog

on:
release:
branches:
- 'li-dev/**'
types: [published]
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
id: extract_branch
- name: Update the version
run: |
sh .github/workflows/version-upgrade.sh ${{ steps.extract_branch.outputs.branch }}
- name: Build with Maven
run: |
mvn clean deploy -DskipTests -s .github/workflows/settings.xml -DretryFailedDeploymentCount=3
env:
MVN_DEPLOY_JFROG_KEY: ${{ secrets.MVN_DEPLOY_JFROG_KEY }}
MVN_DEPLOY_JFROG_USER: ${{ secrets.MVN_DEPLOY_JFROG_USER }}

79 changes: 79 additions & 0 deletions .github/workflows/old_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>

<!-- Resolve arficacts -->
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>
false
</enabled>
</snapshots>
<id>
bintray-linkedin-maven
</id>
<name>
bintray
</name>
<url>
https://linkedin.bintray.com/maven
</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>
false
</enabled>
</snapshots>
<id>
bintray-linkedin-maven
</id>
<name>
bintray-plugins
</name>
<url>
https://linkedin.bintray.com/maven
</url>
</pluginRepository>
</pluginRepositories>
<id>
bintray
</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>
bintray
</activeProfile>
</activeProfiles>

<!-- Bintray credentials - env vars are secrets that come from linkedin/zookeeper repo secrets -->
<servers>
<server>
<id>bintray-linkedin-maven</id>
<username>${env.MVN_DEPLOY_BINTRAY_USER}</username>
<password>${env.MVN_DEPLOY_BINTRAY_KEY}</password>
</server>
</servers>
</settings>
80 changes: 21 additions & 59 deletions .github/workflows/settings.xml
Original file line number Diff line number Diff line change
@@ -1,79 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>

<!-- Resolve arficacts -->
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<!-- the following env vars come from linkedin/zookeeper secrets -->
<id>jfrog-linkedin</id>
<username>${env.MVN_DEPLOY_JFROG_USER}</username>
<password>${env.MVN_DEPLOY_JFROG_KEY}</password>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>
false
</enabled>
<enabled>false</enabled>
</snapshots>
<id>
bintray-linkedin-maven
</id>
<name>
bintray
</name>
<url>
https://linkedin.bintray.com/maven
</url>
<id>jfrog-linkedin</id>
<name>jfrog</name>
<url>https://linkedin.jfrog.io/artifactory/open-source</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>
false
</enabled>
<enabled>false</enabled>
</snapshots>
<id>
bintray-linkedin-maven
</id>
<name>
bintray-plugins
</name>
<url>
https://linkedin.bintray.com/maven
</url>
<id>jfrog-linkedin</id>
<name>jfrog-plugins</name>
<url>https://linkedin.jfrog.io/artifactory/open-source</url>
</pluginRepository>
</pluginRepositories>
<id>
bintray
</id>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>
bintray
</activeProfile>
<activeProfile>artifactory</activeProfile>
</activeProfiles>

<!-- Bintray credentials - env vars are secrets that come from linkedin/zookeeper repo secrets -->
<servers>
<server>
<id>bintray-linkedin-maven</id>
<username>${env.MVN_DEPLOY_BINTRAY_USER}</username>
<password>${env.MVN_DEPLOY_BINTRAY_KEY}</password>
</server>
</servers>
</settings>

6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -924,9 +924,9 @@

<distributionManagement>
<repository>
<id>bintray-linkedin-maven</id>
<name>linkedin-maven</name>
<url>https://api.bintray.com/maven/linkedin/maven/zookeeper/;publish=1;override=1</url>
<id>jfrog-linkedin</id>
<name>linkedin-releases</name>
<url>https://linkedin.jfrog.io/artifactory/zookeeper</url>
</repository>
</distributionManagement>
</project>
2 changes: 1 addition & 1 deletion zookeeper-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>publish-test-jar</id>
<id>Jar Tests Package</id>
<goals>
<goal>test-jar</goal>
</goals>
Expand Down

0 comments on commit a5f3e48

Please sign in to comment.