Skip to content

Include only .jar files in the java.zip release artifact #2

Include only .jar files in the java.zip release artifact

Include only .jar files in the java.zip release artifact #2

Workflow file for this run

name: Build everything (and create a release)
on: push
env:
JAVA_VERSION: '8'
jobs:
build:
runs-on: windows-latest
environment: dev
steps:
- name: 'Checkout GitHub action'
uses: actions/checkout@v3
- name: Setup Java Sdk ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- name: 'Create "dependencies" directory'
shell: pwsh
run: |
[IO.Directory]::CreateDirectory("dependencies")
- name: 'The ADS API is available as a secret. It is a base64-encoded .zip file.'
shell: pwsh
env:
ADS_API_ZIP_BASE64: ${{ secrets.ADS_API_ZIP_BASE64 }}
run: |
[IO.File]::WriteAllBytes("dependencies\AdsApi.zip", [Convert]::FromBase64String("$env:ADS_API_ZIP_BASE64"))
- name: 'Put the contents of the "AdsApi.zip" archive into the "dependencies" directory.'
shell: pwsh
run: |
Expand-Archive "dependencies\AdsApi.zip" -DestinationPath dependencies\
- name: 'Run the bootstrap batch script'
shell: cmd
run: |
CALL bootstrap.bat
- name: 'Compress documentation for release'
if: github.ref == 'refs/heads/main'
shell: pwsh
run: |
Compress-Archive -Path dist\doc\* -DestinationPath dist\documentation.zip
- name: 'Compress .jar files for release'
if: github.ref == 'refs/heads/main'
shell: pwsh
run: |
Compress-Archive -Path dist\*.jar -DestinationPath dist\java.zip
- name: 'Compress .dll files for release'
if: github.ref == 'refs/heads/main'
shell: pwsh
run: |
Compress-Archive -Path dist\*.dll -DestinationPath dist\win-x64.zip
- name: Create release
if: github.ref == 'refs/heads/main'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 3.0.0-${{ github.run_number }}
release_name: 3.0.0-${{ github.run_number }}
generate_release_notes: true
- name: 'Upload release asset: documentation.zip'
if: github.ref == 'refs/heads/main'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/documentation.zip
asset_name: documentation.zip
asset_content_type: application/zip
- name: 'Upload release asset: java.zip'
if: github.ref == 'refs/heads/main'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/java.zip
asset_name: java.zip
asset_content_type: application/zip
- name: 'Upload release asset: win-x64.zip'
if: github.ref == 'refs/heads/main'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/win-x64.zip
asset_name: win-x64.zip
asset_content_type: application/zip