Skip to content

Commit

Permalink
Pass version between workflow steps
Browse files Browse the repository at this point in the history
  • Loading branch information
nickebbitt committed Mar 17, 2020
1 parent 925b655 commit 3516c28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
java-version: 1.8

- name: Publish artifact
id: publish-artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
Expand All @@ -28,6 +29,7 @@ jobs:
echo "New version: ${NEW_VERSION}"
echo "Github username: ${GITHUB_ACTOR}"
./gradlew -Pversion=${NEW_VERSION} publish
echo "::set-output name=new_version::${NEW_VERSION}"
- name: Create Release
id: create-release
Expand All @@ -47,6 +49,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build/libs/chaos-kraken-0.0.1-SNAPSHOT.jar
asset_path: ./build/libs/chaos-kraken-${{ steps.publish-artifact.outputs.new_version }}.jar
asset_name: chaos-kraken.jar
asset_content_type: application/jar
17 changes: 8 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@ publishing {
}

repositories {
// maven {
// name = "GitHubPackages"
// url = uri("https://maven.pkg.github.com/autotraderuk/chaos-kraken")
// credentials {
// username = System.getenv("GITHUB_ACTOR")
// password = System.getenv("GITHUB_TOKEN")
// }
// }
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/autotraderuk/chaos-kraken")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit 3516c28

Please sign in to comment.