Skip to content

Commit

Permalink
Pushing package and build information
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasperson committed Mar 14, 2021
1 parent 5db2a8c commit 4937cc2
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,60 @@ jobs:

steps:
- uses: actions/checkout@v1

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: install Octopus Deploy CLI
uses: OctopusDeploy/install-octocli@v1
with:
version: 7.4.2

- name: Update version
run: mvn versions:set -DnewVersion=0.1.${{ github.run_number }}

- name: List dependencies
run: mvn dependency:tree

- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B package --file pom.xml -DfinalName=app

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 0.1.${{ github.run_number }}
release_name: Release 0.1.${{ github.run_number }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app.jar
asset_name: target/app.jar
asset_content_type: application/zip

- name: Rename package
run: mv target/app.jar target/app.0.1.${{ github.run_number }}.jar

- name: Push Package
run: octo push --space=${{ secrets.OCTOPUS_SERVER_SPACE}} --server=${{ secrets.OCTOPUS_SERVER_URL }} --apiKey=${{ secrets.OCTOPUS_API_KEY }} target/app.0.1.${{ github.run_number }}.jar

- name: Generate Octopus Deploy build information
uses: xo-energy/[email protected]
with:
octopus_api_key: ${{ secrets.OCTOPUS_API_KEY }}
octopus_server: ${{ secrets.OCTOPUS_SERVER_URL }}
octopus_space: ${{ secrets.OCTOPUS_SERVER_SPACE}}
output_path: octopus
push_package_ids: app
push_version: ${{ github.ref }}

0 comments on commit 4937cc2

Please sign in to comment.