Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit c7308fe

Browse files
authored
Release version 3.1.0 (PR #97)
Release version 3.1.0
2 parents ab5c225 + 475d0cf commit c7308fe

File tree

5 files changed

+378
-150
lines changed

5 files changed

+378
-150
lines changed

.github/workflows/release.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Release
2+
3+
# Trigger the workflow only on tags
4+
on:
5+
push:
6+
tags:
7+
- 'v[0-9]+.[0-9]+.[0-9]+'
8+
9+
10+
jobs:
11+
12+
draft_release:
13+
name: Create draft release
14+
runs-on: ubuntu-latest
15+
16+
outputs:
17+
release_id: ${{ steps.create_draft_release.outputs.id }}
18+
upload_url: ${{ steps.create_draft_release.outputs.upload_url }}
19+
20+
steps:
21+
- name: Get version from tag
22+
id: tag_name
23+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
24+
25+
- uses: actions/checkout@v2
26+
27+
- name: Get Changelog Entry
28+
id: changelog_reader
29+
uses: mindsers/changelog-reader-action@v2
30+
with:
31+
version: ${{ env.RELEASE_VERSION }}
32+
path: ./CHANGELOG.md
33+
34+
- name: Create draft release
35+
id: create_draft_release
36+
uses: actions/create-release@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
39+
with:
40+
tag_name: ${{ github.ref }}
41+
release_name: ${{ github.ref }}
42+
draft: true
43+
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
44+
body: ${{ steps.changelog_reader.outputs.changes }}
45+
46+
- name: ZIP uncompiled universalJavaApplicationStub
47+
run: |
48+
echo "Zipping uncompiled script..."
49+
zip --junk-paths universalJavaApplicationStub-uncompiled.zip src/universalJavaApplicationStub
50+
51+
- name: Upload release assets
52+
uses: actions/upload-release-asset@v1
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
55+
with:
56+
upload_url: ${{ steps.create_draft_release.outputs.upload_url }}
57+
asset_name: universalJavaApplicationStub-v${{ env.RELEASE_VERSION }}-source.zip
58+
asset_path: ./universalJavaApplicationStub-uncompiled.zip
59+
asset_content_type: application/zip
60+
61+
62+
compile:
63+
name: Compile the stub on ${{ matrix.os }}
64+
needs: draft_release # we need to know the upload URL
65+
runs-on: ${{ matrix.os }}
66+
strategy:
67+
matrix:
68+
os: [ macos-10.15 ] # macos-11.0
69+
70+
steps:
71+
- uses: actions/checkout@v2
72+
73+
- name: Set env
74+
run: echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
75+
76+
- name: Install shc via HomeBrew
77+
run: |
78+
brew install shc
79+
shc -h
80+
81+
- name: Compile universalJavaApplicationStub
82+
run: |
83+
echo "Running shc..."
84+
shc -r -f src/universalJavaApplicationStub
85+
86+
- name: ZIP universalJavaApplicationStub binary
87+
run: |
88+
echo "Zipping binary..."
89+
mv src/universalJavaApplicationStub.x universalJavaApplicationStub
90+
rm src/universalJavaApplicationStub.x.c
91+
zip --junk-paths universalJavaApplicationStub-${{ matrix.os }}.zip universalJavaApplicationStub
92+
93+
- name: Upload release assets
94+
uses: actions/upload-release-asset@v1
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
97+
with:
98+
upload_url: ${{ needs.draft_release.outputs.upload_url }}
99+
asset_name: universalJavaApplicationStub-${{ env.RELEASE_TAG }}-binary-${{ matrix.os }}.zip
100+
asset_path: ./universalJavaApplicationStub-${{ matrix.os }}.zip
101+
asset_content_type: application/zip
102+
103+
104+
publish_release:
105+
name: Publish drafted release
106+
needs: [ draft_release, compile ]
107+
runs-on: ubuntu-latest
108+
109+
steps:
110+
- uses: eregon/publish-release@v1
111+
env:
112+
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
113+
with:
114+
release_id: ${{ needs.draft_release.outputs.release_id }}

.github/workflows/test.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ on: [push, pull_request]
77
jobs:
88

99
tests:
10-
name: Run bash function tests
11-
runs-on: macos-latest
10+
name: Run bash function tests on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ macos-10.15 ] # macos-11.0
1215

1316
steps:
1417
- uses: actions/checkout@v2
1518

16-
- name: Log Mac OS version information
17-
run: |
18-
sw_vers
19-
2019
# Run the 'java-version-tester' script and show&save (`tee`) the output to a
2120
# logfile; then grep the logfile for 'FAILED' entries which would cause grep
2221
# to exit with 0; then run 'test' command and swap the grep exit code
@@ -30,16 +29,15 @@ jobs:
3029
3130
3231
shellcheck:
33-
name: Check bash syntax with shellcheck
34-
runs-on: macos-latest
32+
name: Check bash syntax with shellcheck on ${{ matrix.os }}
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
matrix:
36+
os: [ macos-10.15 ] # macos-11.0
3537

3638
steps:
3739
- uses: actions/checkout@v2
3840

39-
- name: Log Mac OS version information
40-
run: |
41-
sw_vers
42-
4341
- name: Install shellcheck via HomeBrew
4442
run: |
4543
brew install shellcheck

0 commit comments

Comments
 (0)