Update main.yml #13
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- actions # Trigger on pushes to the "actions" branch | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' # JDK version | |
distribution: 'adopt' # Set the Java distribution | |
- name: Install Ant | |
run: sudo apt-get install -y ant | |
- name: Build the project | |
run: ant -Dplugin.version=${{ github.sha }} | |
- name: Archive artifacts | |
run: | | |
mkdir -p dist | |
cp dist/datapower-v*.zip dist/ | |
cp dist/dcm.jar dist/ | |
release: | |
runs-on: ubuntu-20.04 | |
needs: build # Release job depends on successful completion of the build job | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Create GitHub release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: "actions-${{ github.sha }}" # Tag name format | |
release_name: "Plugin version: ${{ github.sha }}" # Release name format | |
body: | | |
Release notes for actions-${{ github.sha }}. | |
- Plugin version: ${{ github.sha }} | |
draft: false | |
prerelease: false | |
- name: Upload release assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/datapower-v*.zip # Path to your zip file | |
asset_name: datapower-v.zip # Name of the asset | |
asset_content_type: application/zip |