Skip to content

Commit c7bb236

Browse files
authored
Merge pull request #60 from rundeck-plugins/github-actions
add github actions
2 parents 9cc48a1 + 79100c1 commit c7bb236

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

Diff for: .github/workflows/build.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Java CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
- name: Get Fetch Tags
15+
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
16+
- name: Set up JDK 1.8
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 1.8
20+
- name: Grant execute permission for gradlew
21+
run: chmod +x gradlew
22+
- name: Build with Gradle
23+
run: ./gradlew build
24+
- name: Get Release Version
25+
id: get_version
26+
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
27+
- name: Upload docker-container zip
28+
uses: actions/[email protected]
29+
with:
30+
# Artifact name
31+
name: docker-container-${{ steps.get_version.outputs.VERSION }}
32+
# Directory containing files to upload
33+
path: ./build/libs/docker-container-${{ steps.get_version.outputs.VERSION }}.zip

Diff for: .github/workflows/release.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
# Sequence of patterns matched against refs/tags
4+
tags:
5+
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+
7+
name: Create Release
8+
9+
jobs:
10+
build:
11+
name: Upload Release Asset
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- name: set up JDK 1.8
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 1.8
22+
- name: Build with Gradle
23+
run: ./gradlew build
24+
- name: Get Release Version
25+
id: get_version
26+
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
27+
- name: Create Release
28+
id: create_release
29+
uses: actions/[email protected]
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
tag_name: ${{ github.ref }}
34+
release_name: Release ${{ steps.get_version.outputs.VERSION }}
35+
draft: false
36+
prerelease: false
37+
38+
- name: Upload Plugin (zip)
39+
id: upload-release-asset
40+
uses: actions/upload-release-asset@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
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
45+
asset_path: ./build/libs/docker-container-${{ steps.get_version.outputs.VERSION }}.zip
46+
asset_name: docker-container-${{ steps.get_version.outputs.VERSION }}.zip
47+
asset_content_type: application/zip
48+

0 commit comments

Comments
 (0)