-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create release during builds of the main branch
- Loading branch information
1 parent
cc80497
commit 4fab4f4
Showing
2 changed files
with
103 additions
and
41 deletions.
There are no files selected for viewing
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
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 |
This file was deleted.
Oops, something went wrong.