Skip to content

Commit de6d19f

Browse files
author
Timothy Place
committed
api and ci update
1 parent d2b55e8 commit de6d19f

File tree

2 files changed

+45
-39
lines changed

2 files changed

+45
-39
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v2
15+
16+
- uses: benjlevesque/[email protected]
17+
id: short-sha
18+
with:
19+
length: 7
1520

1621
- name: configure_macos
1722
if: matrix.os == 'macos-latest'
@@ -37,12 +42,12 @@ jobs:
3742
env:
3843
GITHUB_REPOSITORY: ${{ github.repository }}
3944
GITHUB_SHA: ${{ github.sha }}
40-
GITHUB_CONFIG: ${{ matrix.config }}
45+
GITHUB_CONFIG: ${{ matrix.config }}
4146
run: |
4247
PACKAGE_NAME=`echo $GITHUB_REPOSITORY | sed 's/.*\///g'`
4348
PACKAGE_REV=`echo $GITHUB_SHA | sed -e 's/^[[:alnum:]]\{7\}/&-/g' | sed 's/-.*//'`
4449
PACKAGE_CONFIG=`echo $GITHUB_CONFIG`
45-
mkdir $PACKAGE_NAME
50+
mkdir -p $PACKAGE_NAME
4651
if [ -e package-info.json ]; then cp package-info.json $PACKAGE_NAME; fi
4752
for f in *.md; do [ -e "$f" ] && cp "$f" $PACKAGE_NAME ; done
4853
if [ -e icon.png ]; then cp icon.png $PACKAGE_NAME; fi
@@ -66,55 +71,56 @@ jobs:
6671
if [ -d source ]; then cp -r source $PACKAGE_NAME; fi
6772
if [ -d tests ]; then cp -r tests $PACKAGE_NAME; fi
6873
if [ -e $PACKAGE_NAME/ReadMe-Public.md ]; then rm -f $PACKAGE_NAME/ReadMe.md; mv $PACKAGE_NAME/ReadMe-Public.md $PACKAGE_NAME/ReadMe.md; fi
69-
mkdir dist
70-
zip -r dist/$PACKAGE_NAME-mac-$PACKAGE_REV-$PACKAGE_CONFIG.zip $PACKAGE_NAME
7174
7275
- name: package_windows
7376
if: matrix.os == 'windows-latest'
7477
shell: cmd
7578
env:
7679
GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }}
77-
GITHUB_SHA: ${{ github.sha }}
7880
GITHUB_CONFIG: ${{ matrix.config }}
7981
run: |
8082
set PACKAGE_NAME=%GITHUB_REPOSITORY_NAME%
81-
set PACKAGE_REV=%GITHUB_SHA:~0,7%
82-
set PACKAGE_CONFIG=%GITHUB_CONFIG%
83-
echo PACKAGE_NAME: %PACKAGE_NAME%
84-
echo PACKAGE_REV: %PACKAGE_REV%
85-
echo PACKAGE_CONFIG: %GITHUB_CONFIG%
8683
mkdir %PACKAGE_NAME%
87-
cp package-info.json %PACKAGE_NAME%
88-
cp License.md %PACKAGE_NAME%
89-
cp ReadMe.md %PACKAGE_NAME%
90-
cp icon.png %PACKAGE_NAME%
91-
cp CMakeLists.txt %PACKAGE_NAME%
92-
if exist code cp -r code %PACKAGE_NAME%
93-
if exist docs cp -r docs %PACKAGE_NAME%
94-
if exist examples cp -r examples %PACKAGE_NAME%
9584
if exist extensions cp -r extensions %PACKAGE_NAME%
9685
if exist externals cp -r externals %PACKAGE_NAME%
97-
if exist extras cp -r extras %PACKAGE_NAME%
98-
if exist help cp -r help %PACKAGE_NAME%
99-
if exist init cp -r init %PACKAGE_NAME%
100-
if exist java-classes cp -r java-classes %PACKAGE_NAME%
101-
if exist java-doc cp -r java-doc %PACKAGE_NAME%
102-
if exist javascript cp -r javascript %PACKAGE_NAME
103-
if exist jsui cp -r jsui %PACKAGE_NAME%
104-
if exist media cp -r media %PACKAGE_NAME%
105-
if exist misc cp -r misc %PACKAGE_NAME%
106-
if exist patchers cp -r patchers %PACKAGE_NAME%
10786
if exist support cp -r support %PACKAGE_NAME%
108-
if exist source cp -r source %PACKAGE_NAME%
10987
if exist tests cp -r tests %PACKAGE_NAME%
110-
if exist ReadMe-Public.md cp ReadMe-Public.md %PACKAGE_NAME%/ReadMe.md
111-
mkdir dist
112-
7z a dist/%PACKAGE_NAME%-win-%PACKAGE_REV%-%PACKAGE_CONFIG%.zip %PACKAGE_NAME%
88+
89+
- uses: actions/upload-artifact@v2
90+
with:
91+
name: ${{ github.event.repository.name }}-${{ steps.short-sha.outputs.sha }}-${{ matrix.config }}
92+
path: ${{ github.event.repository.name }}
93+
94+
release:
95+
runs-on: ubuntu-latest
96+
needs: package
97+
if: ${{ contains( github.ref, 'refs/tags/' ) }}
98+
99+
steps:
100+
- uses: benjlevesque/[email protected]
101+
id: short-sha
102+
with:
103+
length: 7
104+
105+
- uses: actions/download-artifact@v2
106+
with:
107+
name: ${{ github.event.repository.name }}-${{ steps.short-sha.outputs.sha }}-release
108+
path: ${{ github.event.repository.name }}
109+
110+
- name: Display structure of downloaded files
111+
run: ls -R
112+
working-directory: ${{ github.event.repository.name }}
113+
114+
- name: zip
115+
run: zip -r ${{ github.event.repository.name }}-package-for-max-${{ steps.short-sha.outputs.sha }}.zip ${{ github.event.repository.name }}
116+
117+
- uses: actions/upload-artifact@v2
118+
with:
119+
name: ${{ github.event.repository.name }}-${{ steps.short-sha.outputs.sha }}-zipped-release
120+
path: ${{ github.event.repository.name }}-package-for-max-${{ steps.short-sha.outputs.sha }}.zip
113121

114-
- name: upload
115-
uses: shallwefootball/[email protected]
122+
- uses: ncipollo/[email protected]
116123
with:
117-
aws_key_id: ${{ secrets.S3_ID }}
118-
aws_secret_access_key: ${{ secrets.S3_KEY }}
119-
aws_bucket: cycling74-ci-public
120-
source_dir: 'dist'
124+
artifacts: ${{ github.event.repository.name }}-package-for-max-${{ steps.short-sha.outputs.sha }}.zip
125+
body: "Max Package for all supported platforms"
126+
token: ${{ secrets.GITHUB_TOKEN }}

source/min-api

0 commit comments

Comments
 (0)