-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build using GitHub Actions and publish artifacts to GitHub Releases (#1)
- Loading branch information
Showing
1 changed file
with
46 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,46 @@ | ||
# | ||
# Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
name: build | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
# workflow_dispatch should make manually triggered ci/cd possible | ||
# workflow file (like this) with `workflow_dispatch` after on should exist on the **master** or default branch, | ||
# or there will be no ui for a manual trigger. https://github.community/t/workflow-dispatch-event-not-working/128856/2 | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '8' # major or semver Java version will be acceptable, see https://github.com/marketplace/actions/setup-java-jdk#basic | ||
|
||
- name: Build | ||
run: ./scripts/build-installer.sh | ||
|
||
- name: Set env | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Release | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: ./pravega-sensor-collector/build/distributions/pravega-sensor-collector-*.tgz | ||
draft: true | ||
name: pravega-sensor-collector ${{ env.RELEASE_VERSION }} |