1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Disable publishing builds to download.vcmi.eu except develop. Added artifacts

This commit is contained in:
Andrii Danylchenko 2021-07-12 22:00:29 +03:00 committed by Arseniy Shestakov
parent 6d8373a473
commit 92a9106e89
3 changed files with 26 additions and 29 deletions

View File

@ -1,9 +1,6 @@
name: CMake
on:
push:
pull_request:
branches: [ develop ]
on: [ push ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
@ -27,10 +24,14 @@ jobs:
- platform: mac
os: macos-latest
test: 0
pack: 1
extension: dmg
- platform: mxe
os: ubuntu-20.04
mxe: i686-w64-mingw32.shared
test: 0
pack: 1
extension: exe
runs-on: ${{ matrix.os }}
@ -74,18 +75,17 @@ jobs:
ninja
- name: Test
if: ${{ matrix.test == 1 }}
run: |
cd ${{github.workspace}}/build
ctest -C Release -V
if: ${{ matrix.test == 1 }}
- name: Upload build
- name: Pack
id: cpack
if: ${{ matrix.pack == 1 }}
run: |
cd ${{github.workspace}}/build
source ${{github.workspace}}/CI/${{matrix.platform}}/upload_package.sh
env:
DEPLOY_RSA: ${{ secrets.DEPLOY_RSA }}
cpack
- name: Additional logs
if: ${{ failure() && steps.cpack.outcome == 'failure' && matrix.platform == 'mxe' }}
@ -93,6 +93,22 @@ jobs:
cat ${{github.workspace}}/build/_CPack_Packages/win32/NSIS/project.nsi
cat ${{github.workspace}}/build/_CPack_Packages/win32/NSIS/NSISOutput.log
- name: Artifacts
if: ${{ matrix.pack == 1 }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
path: ${{github.workspace}}/build/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
- name: Upload build
if: ${{ matrix.pack == 1 && github.ref == 'refs/heads/develop' }}
run: |
cd ${{github.workspace}}/build
source ${{github.workspace}}/CI/${{matrix.platform}}/upload_package.sh
env:
DEPLOY_RSA: ${{ secrets.DEPLOY_RSA }}
PACKAGE_EXTENSION: ${{ matrix.extension }}
- uses: act10ns/slack@v1
with:
status: ${{ job.status }}

View File

@ -1,17 +0,0 @@
#!/bin/sh
if [ -z "$DEPLOY_RSA" ];
then
# Due to security measures travis not expose encryption keys for PR from forks
echo "Build generation is skipped for forks"
exit 0
fi
cpack
echo "$DEPLOY_RSA" > /tmp/deploy_rsa
chmod 600 /tmp/deploy_rsa
eval "$(ssh-agent -s)"
ssh-add /tmp/deploy_rsa
sftp -r -o StrictHostKeyChecking=no travis@beholder.vcmi.eu <<< "put $VCMI_PACKAGE_FILE_NAME.exe /incoming/$VCMI_PACKAGE_FILE_NAME.exe"

View File

@ -6,12 +6,10 @@ then
exit 0
fi
cpack
echo "$DEPLOY_RSA" > /tmp/deploy_rsa
chmod 600 /tmp/deploy_rsa
eval "$(ssh-agent -s)"
ssh-add /tmp/deploy_rsa
sftp -r -o StrictHostKeyChecking=no travis@beholder.vcmi.eu <<< "put $VCMI_PACKAGE_FILE_NAME.dmg /incoming/$VCMI_PACKAGE_FILE_NAME.dmg"
sftp -r -o StrictHostKeyChecking=no travis@beholder.vcmi.eu <<< "put $VCMI_PACKAGE_FILE_NAME.$PACKAGE_EXTENSION /incoming/$VCMI_PACKAGE_FILE_NAME.$PACKAGE_EXTENSION"