-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (88 loc) · 3.17 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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\*.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