Skip to content

NBM CI with Maven

NBM CI with Maven #53

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: NBM CI with Maven
#on:
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
on:
workflow_dispatch:
# Inputs the workflow accepts.
#inputs:
#name:
# Friendly description to be shown in the UI instead of 'name'
#description: 'Person to greet'
# Default value if no value is explicitly provided
#default: 'World'
# Input has to be provided for the workflow to run
#required: false
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
#Maven Publish to Github
#server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
#settings-path: ${{ github.workspace }} # location for the settings.xml file
#Maven Publish to Central
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
#TODO
- name: Get Next Version
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dproject.version=next.version -Dexpression=next.version -q -DforceStdout)" >> $GITHUB_ENV
echo "RELEASE_DAY=$(date +%d)" >> $GITHUB_ENV
echo "RELEASE_MONTH=$(date +%m)" >> $GITHUB_ENV
echo "RELEASE_YEAR=$(date +%y)" >> $GITHUB_ENV
- name: Set Spec Version
run: |
sed -i "s/OpenIDE-Module-Specification-Version:.*/OpenIDE-Module-Specification-Version: ${{ env.RELEASE_VERSION }}/" src/main/nbm/manifest.mf
- name: Build with RELEASE130
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE130 -Dnext.version=RELEASE130-${{ env.RELEASE_VERSION }}
echo "SIZE_13=$(wc -c target/nbm/python-RELEASE130-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
GITHUB_TOKEN: ${{ github.token }}
- name: Create Release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}
tag_name: ${{ env.RELEASE_VERSION }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Attach RELEASE130 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE130-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE130-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE140
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE140 -Dnext.version=RELEASE140-${{ env.RELEASE_VERSION }}
echo "SIZE_14=$(wc -c target/nbm/python-RELEASE140-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE140 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE140-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE140-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE150
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE150 -Dnext.version=RELEASE150-${{ env.RELEASE_VERSION }}
echo "SIZE_15=$(wc -c target/nbm/python-RELEASE150-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE150 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE150-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE150-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE160
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE160 -Dnext.version=RELEASE160-${{ env.RELEASE_VERSION }}
echo "SIZE_16=$(wc -c target/nbm/python-RELEASE160-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE160 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE160-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE160-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE170
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE170 -Dnext.version=RELEASE170-${{ env.RELEASE_VERSION }}
echo "SIZE_17=$(wc -c target/nbm/python-RELEASE170-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE170 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE170-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE170-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE180
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE180 -Dnext.version=RELEASE180-${{ env.RELEASE_VERSION }}
echo "SIZE_18=$(wc -c target/nbm/python-RELEASE180-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE180 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE180-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE180-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE190
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE190 -Dnext.version=RELEASE190-${{ env.RELEASE_VERSION }}
echo "SIZE_19=$(wc -c target/nbm/python-RELEASE190-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE190 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE190-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE190-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE200
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE200 -Dnext.version=RELEASE200-${{ env.RELEASE_VERSION }}
echo "SIZE_20=$(wc -c target/nbm/python-RELEASE200-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE200 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE200-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE200-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
#TODO
# - name: Update PPUCs
# id: my_string
# run: |
# STRING_13=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE130-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_13}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE130-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_14=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE140-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_14}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE140-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_15=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE150-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_15}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE150-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_16=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE160-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_16}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE160-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_17=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE170-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_17}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE170-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_18=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE180-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_18}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE180-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# echo "$STRING_13" > ppuc/13/updates.xml
# echo "$STRING_14" > ppuc/14/updates.xml
# echo "$STRING_15" > ppuc/15/updates.xml
# echo "$STRING_16" > ppuc/16/updates.xml
# echo "$STRING_17" > ppuc/17/updates.xml
# echo "$STRING_18" > ppuc/18/updates.xml
# git config --global user.name "albilu"
# git config --global user.email "[email protected]"
# git add ppuc/\*.*
# git commit -m "Update PPUCs"
# git push --force origin master
#- name: Publish to GitHub Packages Apache Maven
# run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
# env:
# GITHUB_TOKEN: ${{ github.token }}
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
#- name: Update dependency graph
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6