Skip to content

Commit

Permalink
Create build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryBorek authored May 29, 2021
1 parent 4b8701d commit ab6c271
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [release ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 1.11
- name: "Get Information"
run: |
echo 'VERSION='$(cat pom.xml | grep "^ <version>.*</version>$" | awk -F'[><]' '{print $3}') >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: |
Release Automatically Generated by software... Please change draft to add changelog.
draft: true
prerelease: false
# Runs a single command using the runners shell
- name: Build Software
run: mvn -B package --file pom.xml

# Runs a set of commands using the runners shell
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
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: ./target/AgentLib-${{ env.VERSION }}.jar
asset_name: AgentLib-${{ env.VERSION }}.jar
asset_content_type: application/zip

0 comments on commit ab6c271

Please sign in to comment.