diff --git a/.github/workflows/maven-release.yaml b/.github/workflows/maven-release.yaml new file mode 100644 index 00000000..9fd29e6a --- /dev/null +++ b/.github/workflows/maven-release.yaml @@ -0,0 +1,31 @@ +# This workflow will put the project in our staging repo +name: Releasing Project to maven + +on: + release: + types: [ published ] + +jobs: + build: + if: endsWith(github.ref, "-lib") + env: + AWS_DEFAULT_REGION: us-east-1 + AWS_REGION: us-east-1 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Java & publishing credentials + uses: actions/setup-java@v1 + with: + java-version: 8 + server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml + server-username: SONATYPE_USERNAME # env variable for username in deploy + server-password: SONATYPE_PASSWORD # env variable for token in deploy + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + - name: Deploy to sonatype staging repo + run: mvn deploy -Ppublishing + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.github/workflows/pr-ci.yaml b/.github/workflows/pr-ci.yaml new file mode 100644 index 00000000..d7bab279 --- /dev/null +++ b/.github/workflows/pr-ci.yaml @@ -0,0 +1,49 @@ +# This workflow will install dependencies, run tests for both plugin and library components +name: CloudFormation CLI Java Plugin Pull Request CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + env: + AWS_DEFAULT_REGION: us-east-1 + AWS_REGION: us-east-1 + strategy: + matrix: + python: [3.6, 3.7, 3.8] + java: [8, 11] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Set up Java ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Install python dependencies + run: | + pip install --upgrade 'attrs==19.2.0' wheel -r https://raw.githubusercontent.com/aws-cloudformation/cloudformation-cli/master/requirements.txt + - name: Install cloudformation-cli-java-plugin + run: | + pip install . + - name: Run pre-commit, twine checks for cloudformation-cli-java-plugin + run: | + pre-commit run --all-files + python setup.py sdist bdist_wheel + twine check ./dist/* + - name: Verify java package + run: + mvn verify + - name: Integration standard e2e + run: + ./e2e_test.sh 1 + - name: Integration guided e2e + run: + ./e2e_test.sh 2 diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml new file mode 100644 index 00000000..8907a338 --- /dev/null +++ b/.github/workflows/pypi-release.yaml @@ -0,0 +1,27 @@ +# This workflow will release project to PyPI +name: CloudFormation CLI Java Plugin Release + +on: + release: + types: [ published ] + +jobs: + build: + if: endsWith(github.ref, "-plugin") + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + pip install --upgrade wheel twine + - name: Package project + run: | + python setup.py sdist bdist_wheel + - name: Publish distribution 📦 to PyPI (If triggered from release) + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_KEY_CLOUDFORMATION_CLI_JAVA_PLUGIN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7cf0f5eb..00000000 --- a/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -dist: bionic -jdk: openjdk11 -cache: - - pip - - directories: - - $HOME/.m2 -env: - global: - - AWS_REGION="us-east-1" - - AWS_DEFAULT_REGION=$AWS_REGION -before_install: - - > - pip install --upgrade pip 'attrs==19.2.0' - -r https://raw.githubusercontent.com/aws-cloudformation/cloudformation-cli/master/requirements.txt -install: - - pip install . - -script: - - pre-commit run --all-files - -jobs: - include: - - language: python - python: "3.6" - - language: python - python: "3.7" - - language: python - python: "3.8" - - language: java - before_install: skip - install: skip - script: mvn verify - - stage: "integ default" - language: python - python: "3.6" - install: - - mvn install - - pip install . - script: - - DIR=$(mktemp -d) - - cd "$DIR" - - ls -la - - printf "r\nAWS::Foo::Bar\n\n1" | cfn init -vv - - mvn verify - - ls -la - - stage: "integ guided" - language: python - python: "3.6" - install: - - mvn install - - pip install . - script: - - DIR=$(mktemp -d) - - cd "$DIR" - - ls -la - - printf "r\nAWS::Foo::Bar\n\n2" | cfn init -vv - - mvn verify - - ls -la diff --git a/e2e_test.sh b/e2e_test.sh new file mode 100755 index 00000000..c9d2ad4e --- /dev/null +++ b/e2e_test.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +DIR=$(mktemp -d) +cd "$DIR" +ls -la + +printf "\n\n$1" | cfn init -t AWS::Foo::Bar -a RESOURCE -vv +ls -la +mvn verify diff --git a/pom.xml b/pom.xml index 0bf257d2..bf2c3109 100644 --- a/pom.xml +++ b/pom.xml @@ -431,6 +431,12 @@ sign + + + --pinentry-mode + loopback + +