Skip to content

Commit 643b124

Browse files
John TompkinsPatMyron
andauthored
GitHub Actions CI (#339)
Converts repo to GitHub actions and removes travisCI build script Co-authored-by: Pat Myron <PatMyron@users.noreply.github.com>
1 parent 071c592 commit 643b124

File tree

6 files changed

+121
-58
lines changed

6 files changed

+121
-58
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will put the project in our staging repo
2+
name: Releasing Project to maven
3+
4+
on:
5+
release:
6+
types: [ published ]
7+
8+
jobs:
9+
build:
10+
if: endsWith(github.ref, "-lib")
11+
env:
12+
AWS_DEFAULT_REGION: us-east-1
13+
AWS_REGION: us-east-1
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Java & publishing credentials
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 8
21+
server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml
22+
server-username: SONATYPE_USERNAME # env variable for username in deploy
23+
server-password: SONATYPE_PASSWORD # env variable for token in deploy
24+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
25+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
26+
- name: Deploy to sonatype staging repo
27+
run: mvn deploy -Ppublishing
28+
env:
29+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
30+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
31+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.github/workflows/pr-ci.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow will install dependencies, run tests for both plugin and library components
2+
name: CloudFormation CLI Java Plugin Pull Request CI
3+
4+
on:
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build:
12+
env:
13+
AWS_DEFAULT_REGION: us-east-1
14+
AWS_REGION: us-east-1
15+
strategy:
16+
matrix:
17+
python: [3.6, 3.7, 3.8]
18+
java: [8, 11]
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python }}
26+
- name: Set up Java ${{ matrix.java }}
27+
uses: actions/setup-java@v1
28+
with:
29+
java-version: ${{ matrix.java }}
30+
- name: Install python dependencies
31+
run: |
32+
pip install --upgrade 'attrs==19.2.0' wheel -r https://raw.githubusercontent.com/aws-cloudformation/cloudformation-cli/master/requirements.txt
33+
- name: Install cloudformation-cli-java-plugin
34+
run: |
35+
pip install .
36+
- name: Run pre-commit, twine checks for cloudformation-cli-java-plugin
37+
run: |
38+
pre-commit run --all-files
39+
python setup.py sdist bdist_wheel
40+
twine check ./dist/*
41+
- name: Verify java package
42+
run:
43+
mvn verify
44+
- name: Integration standard e2e
45+
run:
46+
./e2e_test.sh 1
47+
- name: Integration guided e2e
48+
run:
49+
./e2e_test.sh 2
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow will release project to PyPI
2+
name: CloudFormation CLI Java Plugin Release
3+
4+
on:
5+
release:
6+
types: [ published ]
7+
8+
jobs:
9+
build:
10+
if: endsWith(github.ref, "-plugin")
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python 3.8
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.8
18+
- name: Install dependencies
19+
run: |
20+
pip install --upgrade wheel twine
21+
- name: Package project
22+
run: |
23+
python setup.py sdist bdist_wheel
24+
- name: Publish distribution 📦 to PyPI (If triggered from release)
25+
uses: pypa/gh-action-pypi-publish@master
26+
with:
27+
password: ${{ secrets.PYPI_API_KEY_CLOUDFORMATION_CLI_JAVA_PLUGIN }}

.travis.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

e2e_test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
DIR=$(mktemp -d)
3+
cd "$DIR"
4+
ls -la
5+
6+
printf "\n\n$1" | cfn init -t AWS::Foo::Bar -a RESOURCE -vv
7+
ls -la
8+
mvn verify

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,12 @@
431431
<goals>
432432
<goal>sign</goal>
433433
</goals>
434+
<configuration>
435+
<gpgArguments>
436+
<arg>--pinentry-mode</arg>
437+
<arg>loopback</arg>
438+
</gpgArguments>
439+
</configuration>
434440
</execution>
435441
</executions>
436442
</plugin>

0 commit comments

Comments
 (0)