mirror of
https://github.com/QB64Official/qb64.git
synced 2024-09-28 11:17:47 +00:00
Merge branch 'ci-test' into development
This commit is contained in:
commit
9deb6e4cf2
4 changed files with 50 additions and 102 deletions
|
@ -1,29 +0,0 @@
|
||||||
@ECHO OFF
|
|
||||||
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
|
||||||
cd ..
|
|
||||||
set TIMEX=%TIME: =0%
|
|
||||||
set archive=qb64_%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%-%TIMEX:~0,2%-%TIMEX:~3,2%-%TIMEX:~6,2%_%GITHUB_SHA:~0,7%_win-%PLATFORM%.7z
|
|
||||||
7z a -xr@qb64\.ci\common-exclusion.list -xr@qb64\.ci\win-exclusion.list %archive% qb64
|
|
||||||
|
|
||||||
FOR /L %%i IN (1,1,10) DO (
|
|
||||||
scp %archive% remote-server:autobuilds/development/
|
|
||||||
IF ERRORLEVEL 1 (
|
|
||||||
ECHO scp %archive% failed - attempt %%i/10
|
|
||||||
) ELSE (
|
|
||||||
GOTO :doversion
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
:doversion
|
|
||||||
|
|
||||||
set archive=versioninfo.txt
|
|
||||||
echo Dev build generated on %DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%, from git ^<a href="https://github.com/QB64Team/qb64/commits/development" target="_blank"^>%GITHUB_SHA:~0,7%^</a^> > %archive%
|
|
||||||
|
|
||||||
FOR /L %%i IN (1,1,10) DO (
|
|
||||||
scp %archive% remote-server:autobuilds/development/
|
|
||||||
IF ERRORLEVEL 1 (
|
|
||||||
ECHO scp %archive% failed - attempt %%i/10
|
|
||||||
) ELSE (
|
|
||||||
EXIT /B 0
|
|
||||||
)
|
|
||||||
)
|
|
11
.ci/deploy.ps1
Normal file
11
.ci/deploy.ps1
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
$Bucket = "qb64-dev-builds"
|
||||||
|
$Timestamp = (Get-Date).ToUniversalTime().ToString("yyyy-MM-dd-HH-mm-ss")
|
||||||
|
$Filename = "qb64_${Timestamp}_$($Env:GITHUB_SHA.substring(0,7))_win-${Env:PLATFORM}.7z"
|
||||||
|
|
||||||
|
Set-Location ..
|
||||||
|
7z a '-xr@qb64\.ci\common-exclusion.list' '-xr@qb64\.ci\win-exclusion.list' $Filename qb64
|
||||||
|
$OldFiles = aws --output json --query Contents[].Key s3api list-objects --bucket $Bucket --prefix win-$Env:PLATFORM | ConvertFrom-Json
|
||||||
|
aws s3 cp $Filename "s3://${Bucket}/win-${Env:PLATFORM}/"
|
||||||
|
foreach ($f in $OldFiles) {
|
||||||
|
aws s3 rm "s3://$Bucket/$f"
|
||||||
|
}
|
|
@ -2,18 +2,13 @@
|
||||||
|
|
||||||
OS=$1
|
OS=$1
|
||||||
TZ=UTC now=`date +"%F-%H-%M-%S"`
|
TZ=UTC now=`date +"%F-%H-%M-%S"`
|
||||||
filename="/tmp/qb64_${now}_`echo ${GITHUB_SHA} | sed 's/\(.......\).*$/\1/'`_$OS.tar.gz"
|
BUCKET=qb64-dev-builds
|
||||||
|
filename="/tmp/qb64_${now}_`echo ${GITHUB_SHA} | sed 's/\(.......\).*$/\1/'`_${OS}.tar.gz"
|
||||||
cd ..
|
cd ..
|
||||||
tar --create --auto-compress --file ${filename} --exclude-from=qb64/.ci/common-exclusion.list --exclude-from=qb64/.ci/$OS-exclusion.list qb64
|
tar --create --auto-compress --file ${filename} --exclude-from=qb64/.ci/common-exclusion.list --exclude-from=qb64/.ci/$OS-exclusion.list qb64
|
||||||
|
|
||||||
# Send to server
|
current_files=$(aws --output text --query 'Contents[].Key' s3api list-objects --bucket ${BUCKET} --prefix ${OS})
|
||||||
# Sometimes the connection can be a bit flakey, so try multiple times on error
|
aws s3 cp ${filename} s3://${BUCKET}/${OS}/
|
||||||
for i in `seq 1 10`
|
for f in $current_files; do
|
||||||
do scp ${filename} remote-server:autobuilds/development/
|
aws s3 rm s3://${BUCKET}/$f
|
||||||
if [ "$?" -eq 0 ]
|
|
||||||
then exit 0
|
|
||||||
fi
|
|
||||||
echo scp $i failed
|
|
||||||
done
|
done
|
||||||
exit 1
|
|
||||||
|
|
||||||
|
|
95
.github/workflows/run.yml
vendored
95
.github/workflows/run.yml
vendored
|
@ -2,12 +2,11 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- development
|
- development
|
||||||
- ci-test
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux-build:
|
linux-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "contains(github.event.head_commit.message, 'ci-skip')"
|
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
@ -25,47 +24,40 @@ jobs:
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: development
|
branch: development
|
||||||
- name: Set deployment SSH key
|
- name: Setup aws
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
uses: shimataro/ssh-key-action@v2.1.0
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
# "qb64.org ssh-rsa AAAA" etc.
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
aws-region: us-east-2
|
||||||
config: |
|
- name: Publish to S3
|
||||||
Host remote-server
|
|
||||||
HostName qb64.org
|
|
||||||
User m6rosupy1q2t
|
|
||||||
- name: Package and deploy
|
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
run: .ci/deploy.sh lnx
|
run: .ci/deploy.sh lnx
|
||||||
|
|
||||||
macos-build:
|
macos-build:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
if: "contains(github.event.head_commit.message, 'ci-skip')"
|
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Bootstrap compiler
|
- name: Bootstrap compiler
|
||||||
run: .ci/bootstrap.sh osx
|
run: .ci/bootstrap.sh osx
|
||||||
- name: Compile
|
- name: Compile
|
||||||
run: .ci/compile.sh
|
run: .ci/compile.sh
|
||||||
- name: Set deployment SSH key
|
- name: Setup aws
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
uses: shimataro/ssh-key-action@v2.1.0
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
config: |
|
aws-region: us-east-2
|
||||||
Host remote-server
|
- name: Publish to S3
|
||||||
HostName qb64.org
|
|
||||||
User m6rosupy1q2t
|
|
||||||
- name: Package and deploy
|
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
run: .ci/deploy.sh osx
|
run: .ci/deploy.sh osx
|
||||||
|
|
||||||
windows-x86-build:
|
windows-x86-build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
if: "contains(github.event.head_commit.message, 'ci-skip')"
|
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||||
env:
|
env:
|
||||||
PLATFORM: x86
|
PLATFORM: x86
|
||||||
steps:
|
steps:
|
||||||
|
@ -74,19 +66,16 @@ jobs:
|
||||||
run: .ci/bootstrap.bat
|
run: .ci/bootstrap.bat
|
||||||
- name: Compile
|
- name: Compile
|
||||||
run: .ci/compile.bat
|
run: .ci/compile.bat
|
||||||
- name: Set deployment SSH key
|
- name: Setup aws
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
uses: shimataro/ssh-key-action@v2.1.0
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
config: |
|
aws-region: us-east-2
|
||||||
Host remote-server
|
- name: Publish to S3
|
||||||
HostName qb64.org
|
|
||||||
User m6rosupy1q2t
|
|
||||||
- name: Package and deploy
|
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
run: .ci/deploy.bat
|
run: .ci/deploy.ps1
|
||||||
|
|
||||||
windows-x64-build:
|
windows-x64-build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
@ -95,35 +84,17 @@ jobs:
|
||||||
PLATFORM: x64
|
PLATFORM: x64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
#- name: Bootstrap compiler
|
- name: Bootstrap compiler
|
||||||
#run: .ci/bootstrap.bat
|
run: .ci/bootstrap.bat
|
||||||
#- name: Compile
|
- name: Compile
|
||||||
#run: .ci/compile.bat
|
run: .ci/compile.bat
|
||||||
- name: Set deployment SSH key
|
- name: Setup aws
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
uses: shimataro/ssh-key-action@v2.1.0
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
config: |
|
aws-region: us-east-2
|
||||||
Host remote-server
|
- name: Publish to S3
|
||||||
HostName qb64.org
|
|
||||||
User m6rosupy1q2t
|
|
||||||
- name: Download
|
|
||||||
run: Invoke-WebRequest https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip -OutFile ngrok.zip
|
|
||||||
- name: Extract
|
|
||||||
run: Expand-Archive ngrok.zip
|
|
||||||
- name: Auth
|
|
||||||
run: .\ngrok\ngrok.exe authtoken $Env:NGROK_AUTH_TOKEN
|
|
||||||
env:
|
|
||||||
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
|
|
||||||
- name: Enable TS
|
|
||||||
run: Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
|
|
||||||
- run: Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
|
|
||||||
- run: Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1
|
|
||||||
- run: Set-LocalUser -Name "runneradmin" -Password (ConvertTo-SecureString -AsPlainText "P@ssw0rd!" -Force)
|
|
||||||
- name: Create Tunnel
|
|
||||||
run: .\ngrok\ngrok.exe tcp 3389
|
|
||||||
- name: Package and deploy
|
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
run: .ci/deploy.bat
|
run: .ci/deploy.ps1
|
||||||
|
|
Loading…
Reference in a new issue