Skip to content

Commit

Permalink
Create release during builds of the main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
vossjannik committed Dec 19, 2023
1 parent cc80497 commit 4fab4f4
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 41 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
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\* -DestinationPath dist\java.zip
- name: 'Compress DLL 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
41 changes: 0 additions & 41 deletions .github/workflows/java.yml

This file was deleted.

0 comments on commit 4fab4f4

Please sign in to comment.