Update main.yml #18
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 this workflow 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' # Use the appropriate JDK version | |
distribution: 'adopt' # Set the Java distribution | |
- name: Install Ant | |
run: sudo apt-get install -y ant | |
- name: Build the project | |
run: ant -Dskip.chkpii=y # Run the specified Ant command | |
- name: Extract Plugin Version from ZIP | |
id: extract_version | |
run: | | |
# Unzip the plugin ZIP file to a temporary directory | |
unzip dist/datapower-v*.zip -d temp_dir | |
release: | |
runs-on: ubuntu-20.04 | |
needs: build # Release job depends on the 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: ${{ env.PLUGIN_VERSION }}" # Release name format | |
body: | | |
Release notes for actions-${{ github.sha }}. | |
- Plugin version: ${{ env.PLUGIN_VERSION }} | |
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 |