Merge pull request #1623 from prusk/feature/updated-referencepushpull… #1223
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy OpenPnP | |
on: | |
push: | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: Java ${{ matrix.java }} | |
strategy: | |
matrix: | |
java: [11, 17, 19] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Setup JDK ${{ matrix.java }} | |
uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ matrix.java }} | |
- name: Build with Maven | |
run: mvn -q -B test | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy | |
needs: test | |
if: github.repository == 'openpnp/openpnp' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test') | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Setup JDK for Deployment | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Build with Maven | |
run: mvn -q -B package -DskipTests | |
- name: Get Branch Name | |
uses: nelonoel/branch-name@v1.0.1 | |
- name: Build Installers | |
run: | | |
wget -q https://openpnp.s3-us-west-2.amazonaws.com/install4j_unix_10_0_5.tar.gz | |
tar -xzf install4j_unix_10_0_5.tar.gz | |
./install4j10.0.5/bin/install4jc -L ${{secrets.INSTALL4J_10_LICENSE_KEY }} | |
VERSION=`java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.color=ALL-UNNAMED -cp target/openpnp-gui-0.0.1-alpha-SNAPSHOT.jar:target/lib org.openpnp.Main --version` | |
./install4j10.0.5/bin/install4jc -r $VERSION -d installers -D mediaFileVersion=$BRANCH_NAME --mac-keystore-password "${{secrets.MAC_CODE_SIGNING_CERT_PASSWORD }}" OpenPnP.install4j | |
mv installers/updates.xml installers/updates-$BRANCH_NAME.xml | |
mkdir -p installers/$BRANCH_NAME/$VERSION | |
cp installers/OpenPnP* installers/$BRANCH_NAME/$VERSION | |
- name: Upload Installers to S3 | |
uses: shallwefootball/upload-s3-action@v1.1.3 | |
with: | |
aws_key_id: ${{ secrets.S3_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.S3_SECRET_ACCESS_KEY }} | |
aws_bucket: openpnp | |
source_dir: 'installers' | |
destination_dir: '' | |
# TODO this was broken during the updates to Java 17. See | |
# https://github.com/openpnp/openpnp/issues/1541 | |
# - name: Update API Docs | |
# run: | | |
# git config --global user.email "jason@vonnieda.org" | |
# git config --global user.name "Jason von Nieda" | |
# git clone --quiet --branch=gh-pages https://${{ secrets.GH_PAGES_TOKEN }}@github.com/openpnp/openpnp gh-pages | |
# cd gh-pages | |
# git rm --ignore-unmatch -rf $BRANCH_NAME | |
# javadoc -sourcepath ../src/main/java -subpackages org.openpnp -d $BRANCH_NAME || true | |
# git add -f . | |
# git commit -m "Lastest javadoc on successful build $GITHUB_RUN_NUMBER auto-pushed to gh-pages" | |
# git push -fq origin gh-pages | |