Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added github workflow for mirroring release artifacts (#387)
* Added github release action file This is to mirror Jenkinsfile Runner releases to GitHub Releases * formatted yaml doc * removed adding source jar to release assets
- Loading branch information
1 parent
49e4874
commit afba6ed
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Publish artifact | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Set version | ||
id: set-version | ||
run: | | ||
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo "::set-output name=project-version::$version" | ||
echo "::set-env name=PROJECT_VERSION::$version" | ||
- run: echo $PROJECT_VERSION | ||
- name: Fetch artifact | ||
id: fetch-artifact | ||
run: | | ||
GROUP_ID=io/jenkins/jenkinsfile-runner | ||
ARTIFACT_ID=jenkinsfile-runner | ||
FILE_NAME=jenkinsfile-runner | ||
PROJECT_VERSION=${{ steps.set-version.outputs.project-version }} | ||
echo "::set-output name=file-name::$FILE_NAME" | ||
wget -q https://repo.jenkins-ci.org/releases/$GROUP_ID/$ARTIFACT_ID/$PROJECT_VERSION/$ARTIFACT_ID-$PROJECT_VERSION.jar \ | ||
-O $FILE_NAME-$PROJECT_VERSION.jar | ||
wget -q https://repo.jenkins-ci.org/releases/$GROUP_ID/$ARTIFACT_ID/$PROJECT_VERSION/$ARTIFACT_ID-$PROJECT_VERSION.zip \ | ||
-O $FILE_NAME-$PROJECT_VERSION.zip | ||
- name: Upload artifact uber jar | ||
id: upload-artifact-uber-jar | ||
uses: actions/upload-release-asset@v1.0.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./${{ steps.fetch-artifact.outputs.file-name }}-${{ steps.set-version.outputs.project-version }}.jar | ||
asset_name: ${{ steps.fetch-artifact.outputs.file-name }}-${{ steps.set-version.outputs.project-version }}.jar | ||
asset_content_type: application/java-archive | ||
- name: Upload artifact minimum package | ||
id: upload-artifact-minimum-package | ||
uses: actions/upload-release-asset@v1.0.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./${{ steps.fetch-artifact.outputs.file-name }}-${{ steps.set-version.outputs.project-version }}.zip | ||
asset_name: ${{ steps.fetch-artifact.outputs.file-name }}-${{ steps.set-version.outputs.project-version }}.zip | ||
asset_content_type: application/zip |