Skip to content

Commit 4937cc2

Browse files
committed
Pushing package and build information
1 parent 5db2a8c commit 4937cc2

1 file changed

Lines changed: 50 additions & 1 deletion

File tree

.github/workflows/maven.yml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,60 @@ jobs:
99

1010
steps:
1111
- uses: actions/checkout@v1
12+
1213
- name: Set up JDK 1.8
1314
uses: actions/setup-java@v1
1415
with:
1516
java-version: 1.8
17+
18+
- name: install Octopus Deploy CLI
19+
uses: OctopusDeploy/install-octocli@v1
20+
with:
21+
version: 7.4.2
22+
23+
- name: Update version
24+
run: mvn versions:set -DnewVersion=0.1.${{ github.run_number }}
25+
1626
- name: List dependencies
1727
run: mvn dependency:tree
28+
1829
- name: Build with Maven
19-
run: mvn -B package --file pom.xml
30+
run: mvn -B package --file pom.xml -DfinalName=app
31+
32+
- name: Create Release
33+
id: create_release
34+
uses: actions/create-release@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
tag_name: 0.1.${{ github.run_number }}
39+
release_name: Release 0.1.${{ github.run_number }}
40+
draft: false
41+
prerelease: false
42+
43+
- name: Upload Release Asset
44+
id: upload-release-asset
45+
uses: actions/upload-release-asset@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
upload_url: ${{ steps.create_release.outputs.upload_url }}
50+
asset_path: app.jar
51+
asset_name: target/app.jar
52+
asset_content_type: application/zip
53+
54+
- name: Rename package
55+
run: mv target/app.jar target/app.0.1.${{ github.run_number }}.jar
56+
57+
- name: Push Package
58+
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
59+
60+
- name: Generate Octopus Deploy build information
61+
uses: xo-energy/action-octopus-build-information@v1.0.0
62+
with:
63+
octopus_api_key: ${{ secrets.OCTOPUS_API_KEY }}
64+
octopus_server: ${{ secrets.OCTOPUS_SERVER_URL }}
65+
octopus_space: ${{ secrets.OCTOPUS_SERVER_SPACE}}
66+
output_path: octopus
67+
push_package_ids: app
68+
push_version: ${{ github.ref }}

0 commit comments

Comments
 (0)