|
| 1 | +name: Build everything (and create a release) |
| 2 | + |
| 3 | +on: push |
| 4 | + |
| 5 | +env: |
| 6 | + JAVA_VERSION: '8' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: windows-latest |
| 11 | + environment: dev |
| 12 | + steps: |
| 13 | + - name: 'Checkout GitHub action' |
| 14 | + uses: actions/checkout@v3 |
| 15 | + |
| 16 | + - name: Setup Java Sdk ${{ env.JAVA_VERSION }} |
| 17 | + uses: actions/setup-java@v1 |
| 18 | + with: |
| 19 | + java-version: ${{ env.JAVA_VERSION }} |
| 20 | + |
| 21 | + - name: 'Create "dependencies" directory' |
| 22 | + shell: pwsh |
| 23 | + run: | |
| 24 | + [IO.Directory]::CreateDirectory("dependencies") |
| 25 | + |
| 26 | + - name: 'The ADS API is available as a secret. It is a base64-encoded .zip file.' |
| 27 | + shell: pwsh |
| 28 | + env: |
| 29 | + ADS_API_ZIP_BASE64: ${{ secrets.ADS_API_ZIP_BASE64 }} |
| 30 | + run: | |
| 31 | + [IO.File]::WriteAllBytes("dependencies\AdsApi.zip", [Convert]::FromBase64String("$env:ADS_API_ZIP_BASE64")) |
| 32 | + |
| 33 | + - name: 'Put the contents of the "AdsApi.zip" archive into the "dependencies" directory.' |
| 34 | + shell: pwsh |
| 35 | + run: | |
| 36 | + Expand-Archive "dependencies\AdsApi.zip" -DestinationPath dependencies\ |
| 37 | +
|
| 38 | + - name: 'Run the bootstrap batch script' |
| 39 | + shell: cmd |
| 40 | + run: | |
| 41 | + CALL bootstrap.bat |
| 42 | +
|
| 43 | + - name: 'Compress documentation for release' |
| 44 | + if: github.ref == 'refs/heads/main' |
| 45 | + shell: pwsh |
| 46 | + run: | |
| 47 | + Compress-Archive -Path dist\doc\* -DestinationPath dist\documentation.zip |
| 48 | +
|
| 49 | + - name: 'Compress .jar files for release' |
| 50 | + if: github.ref == 'refs/heads/main' |
| 51 | + shell: pwsh |
| 52 | + run: | |
| 53 | + Compress-Archive -Path dist\* -DestinationPath dist\java.zip |
| 54 | +
|
| 55 | + - name: 'Compress DLL for release' |
| 56 | + if: github.ref == 'refs/heads/main' |
| 57 | + shell: pwsh |
| 58 | + run: | |
| 59 | + Compress-Archive -Path dist\*.dll -DestinationPath dist\win-x64.zip |
| 60 | +
|
| 61 | + - name: Create release |
| 62 | + if: github.ref == 'refs/heads/main' |
| 63 | + id: create_release |
| 64 | + uses: actions/create-release@v1 |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + with: |
| 68 | + tag_name: 3.0.0-${{ github.run_number }} |
| 69 | + release_name: 3.0.0-${{ github.run_number }} |
| 70 | + generate_release_notes: true |
| 71 | + |
| 72 | + - name: 'Upload release asset: documentation.zip' |
| 73 | + if: github.ref == 'refs/heads/main' |
| 74 | + uses: actions/upload-release-asset@v1 |
| 75 | + env: |
| 76 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + with: |
| 78 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 79 | + asset_path: ./dist/documentation.zip |
| 80 | + asset_name: documentation.zip |
| 81 | + asset_content_type: application/zip |
| 82 | + |
| 83 | + - name: 'Upload release asset: java.zip' |
| 84 | + if: github.ref == 'refs/heads/main' |
| 85 | + uses: actions/upload-release-asset@v1 |
| 86 | + env: |
| 87 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + with: |
| 89 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 90 | + asset_path: ./dist/java.zip |
| 91 | + asset_name: java.zip |
| 92 | + asset_content_type: application/zip |
| 93 | + |
| 94 | + - name: 'Upload release asset: win-x64.zip' |
| 95 | + if: github.ref == 'refs/heads/main' |
| 96 | + uses: actions/upload-release-asset@v1 |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + with: |
| 100 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 101 | + asset_path: ./dist/win-x64.zip |
| 102 | + asset_name: win-x64.zip |
| 103 | + asset_content_type: application/zip |
0 commit comments