Skip to content

Commit

Permalink
Enable automatic release on merge to master (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored Mar 29, 2021
1 parent 34fa2ad commit b688d15
Show file tree
Hide file tree
Showing 14 changed files with 510 additions and 419 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
1 change: 1 addition & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_extends: .github
58 changes: 58 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Note: additional setup is required, see https://github.com/jenkinsci/incrementals-tools#automatic-deployment

name: cd
on:
workflow_dispatch:
check_run:
types:
- completed

jobs:
validate:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }}
steps:
- name: Verify CI status
uses: jenkins-infra/verify-ci-status-action@v1.2.0
id: verify-ci-status
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
output_result: true

- name: Release Drafter
uses: release-drafter/release-drafter@v5
if: steps.verify-ci-status.outputs.result == 'success'
with:
name: next
tag: next
version: next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check interesting categories
uses: jenkins-infra/interesting-category-action@v1.0.0
id: interesting-categories
if: steps.verify-ci-status.outputs.result == 'success'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
runs-on: ubuntu-latest
needs: [validate]
if: needs.validate.outputs.should_release == 'true'
steps:
- name: Check out
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Release
uses: jenkins-infra/jenkins-maven-cd-action@v1.1.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
12 changes: 6 additions & 6 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.0-beta-7</version>
</extension>
</extensions>
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.2</version>
</extension>
</extensions>
3 changes: 2 additions & 1 deletion .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
-Pmight-produce-incrementals
-Dchangelist.format=%d.v%s
2 changes: 2 additions & 0 deletions CHANGELOG.md → CHANGELOG-old.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

See [GitHub releases](https://github.com/jenkinsci/azure-ad-plugin/releases) for all newer versions.

## 1.2.3 (2021-02-20)
* Document update

Expand Down
16 changes: 8 additions & 8 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
-->

<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--
Based on the sun_checks.xml https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/sun_checks.xml
Expand Down Expand Up @@ -48,6 +48,10 @@
<property name="message" value="Line has trailing spaces."/>
</module>

<module name="LineLength">
<property name="max" value="120"/>
</module>

<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
Expand Down Expand Up @@ -76,9 +80,6 @@

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="120"/>
</module>
<module name="MethodLength"/>

<!-- Checks for whitespace -->
Expand Down Expand Up @@ -136,11 +137,10 @@
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="UpperEll"/>
<module name="FileContentsHolder"/>
<module name="SuppressWarningsHolder" />
<module name="SuppressionCommentFilter"/>
</module>

<module name="SuppressionCommentFilter"/>
<module name="SuppressWarningsFilter" />
<module name="SuppressWarningsFilter"/>

</module>
27 changes: 17 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.15</version>
<version>4.17</version>
</parent>

<artifactId>azure-ad</artifactId>
<version>${revision}${changelist}</version>
<version>${changelist}</version>

<name>Azure AD Plugin</name>
<description>A Jenkins authentication &amp; authorization plugin for Azure Active Directory</description>
Expand Down Expand Up @@ -37,15 +37,15 @@
</licenses>

<scm>
<connection>scm:git:ssh://github.com/jenkinsci/azure-ad-plugin.git</connection>
<developerConnection>scm:git:ssh://git@github.com/jenkinsci/azure-ad-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/azure-ad-plugin</url>
<connection>scm:git:ssh://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:ssh://git@github.com/${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>

<properties>
<revision>1.2.4</revision>
<changelist>-SNAPSHOT</changelist>
<changelist>9999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/azure-ad-plugin</gitHubRepo>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

Expand Down Expand Up @@ -180,7 +180,7 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.263.x</artifactId>
<version>19</version>
<version>26</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand All @@ -203,7 +203,7 @@
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.3.4</version>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
Expand Down Expand Up @@ -289,7 +289,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<version>3.1.1</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.41.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>validate</id>
Expand Down
82 changes: 41 additions & 41 deletions src/main/java/com/microsoft/jenkins/azuread/AzureAdGroup.java
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/

package com.microsoft.jenkins.azuread;

import org.acegisecurity.GrantedAuthority;

public class AzureAdGroup implements GrantedAuthority {

private String objectId;

private String groupName;

public AzureAdGroup(String objectId, String groupName) {
this.objectId = objectId;
this.groupName = groupName;
}

@Override
public String getAuthority() {
return groupName;
}

public String getObjectId() {
return objectId;
}

public String getGroupName() {
return groupName;
}

@Override
public String toString() {
return "AzureAdGroup{"
+ "objectId='" + objectId + '\''
+ ", groupName='" + groupName + '\''
+ '}';
}
}
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/

package com.microsoft.jenkins.azuread;

import org.acegisecurity.GrantedAuthority;

public class AzureAdGroup implements GrantedAuthority {

private String objectId;

private String groupName;

public AzureAdGroup(String objectId, String groupName) {
this.objectId = objectId;
this.groupName = groupName;
}

@Override
public String getAuthority() {
return groupName;
}

public String getObjectId() {
return objectId;
}

public String getGroupName() {
return groupName;
}

@Override
public String toString() {
return "AzureAdGroup{"
+ "objectId='" + objectId + '\''
+ ", groupName='" + groupName + '\''
+ '}';
}
}
Loading

0 comments on commit b688d15

Please sign in to comment.