Skip to content

Commit

Permalink
Merge pull request #2 from cody-constine-ttd/master
Browse files Browse the repository at this point in the history
Adding new workflows and setting up pom.xml to publish
  • Loading branch information
tqinli authored May 3, 2022
2 parents 1e69021 + 157f013 commit ce4dbdb
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Build
on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build
run: mvn clean compile
working-directory: ./attestation-aws
30 changes: 30 additions & 0 deletions .github/workflows/download_gpg_key/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Setup Dependancies
inputs:
key:
descriptions: 'The Key to be imported'
required: true
type: string

runs:
using: "composite"
steps:
- name: Setup settings.xml
shell: bash
run: |
mkdir ~/.m2
echo "<settings>" >> ~/.m2/settings.xml
echo " <servers>" >> ~/.m2/settings.xml
echo " <server>" >> ~/.m2/settings.xml
echo " <id>\${repo.id}</id>" >> ~/.m2/settings.xml
echo " <username>\${repo.login}</username>" >> ~/.m2/settings.xml
echo " <password>\${repo.pwd}</password>" >> ~/.m2/settings.xml
echo " </server>" >> ~/.m2/settings.xml
echo " </servers>" >> ~/.m2/settings.xml
echo "</settings>" >> ~/.m2/settings.xml
- name: Import GPG key
shell: bash
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode > private.key
gpg --batch --import private.key
env:
GPG_SIGNING_KEY: ${{ inputs.key }}
15 changes: 15 additions & 0 deletions .github/workflows/publish-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish Snapshot
on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/download_gpg_key
with:
key: ${{ secrets.GPG_KEY }}
- name: Deploy Snapshot
working-directory: ./attestation-aws
run: mvn -Drepo.id=ossrh -Drepo.login=uidadmin -Drepo.pwd="${{ secrets.SONATYPE_REPO_PASSWORD }}" -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" clean deploy
18 changes: 18 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release
on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/download_gpg_key
with:
key: ${{ secrets.GPG_KEY }}
- name: Remove Snapshot
run: mvn versions:set -DremoveSnapshot
working-directory: ./attestation-aws
- name: Deploy Snapshot
working-directory: ./attestation-aws
run: mvn -Drepo.id=ossrh -Drepo.login=uidadmin -Drepo.pwd="${{ secrets.SONATYPE_REPO_PASSWORD }}" -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" clean deploy
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*/target/
100 changes: 96 additions & 4 deletions attestation-aws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,47 @@

<groupId>com.uid2</groupId>
<artifactId>attestation-aws</artifactId>
<version>1.0.0</version>
<version>1.1.0-SNAPSHOT</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>AWS Enclave attestation</description>
<url>https://github.com/IABTechLab/uid2docs</url>
<packaging>jar</packaging>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>UID2 team</name>
<email>unifiedid-admin@thetradedesk.com</email>
<organization>UID</organization>
<organizationUrl>https://github.com/IABTechLab/uid2docs</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:get:ssh://github.com:IABTechLab/nsm-java.git</connection>
<developerConnection>scm:get:ssh://github.com:IABTechLab/nsm-java.git</developerConnection>
<url>https://github.com/IABTechLab/nsm-java</url>
</scm>
<dependencies>
<dependency>
<groupId>com.uid2</groupId>
<artifactId>enclave-attestation-api</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</dependency>
</dependencies>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<build>
<plugins>
Expand All @@ -30,7 +57,29 @@
<target>6</target>
</configuration>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand All @@ -39,6 +88,49 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>write-project-properties</goal>
</goals>
<configuration>
<outputFile>${project.build.outputDirectory}/${project.artifactId}.properties</outputFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
</project>

0 comments on commit ce4dbdb

Please sign in to comment.