forked from febiosoftware/FEBioStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (129 loc) · 4.55 KB
/
Copy pathlinux.yml
File metadata and controls
130 lines (129 loc) · 4.55 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
on:
#schedule:
# - cron: '30 6 * * *' #0630 UTC kick off full build and regression
push:
branches: [ ci/* ]
#workflow_dispatch:
# inputs:
# runTests:
# description: "Run tests?"
# required: false
# type: boolean
# default: false
env:
AWS_REGION: us-east-1
AWS_SUBNET_ID: subnet-064f21b53fc72cf44
AWS_SG_ID: sg-0ca7912782cf1538b
AMI_ID: ami-02174e6b877bfe676
AWS_INSTANCE_TYPE: c5a.4xlarge
AWS_AVAILABILITY_ZONE: us-east-1b
OS: linux
KEY_PAIR: win
jobs:
start-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Start EC2 runner
id: start-ec2-runner
uses: tundranerd/ec2-multiple-github-runners@multi-os-multi-runner
with:
mode: start
key-pair: ${{ env.KEY_PAIR }}
os: ${{ env.OS }}
github-token: ${{ secrets.GH_TOKEN}}
ec2-image-id: ${{ env.AMI_ID}}
ec2-instance-type: ${{ env.AWS_INSTANCE_TYPE }}
subnet-id: ${{ env.AWS_SUBNET_ID }}
security-group-id: ${{ env.AWS_SG_ID }}
availability-zone: ${{ env.AWS_AVAILABILITY_ZONE }}
wait-for-registry-timeout: 5
aws-resource-tags: > # optional, requires additional permissions
[
{"Key": "Name", "Value": "ec2-github-runner"},
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"},
{"Key": "os", "Value": "${{ env.OS }}"}
]
build:
name: Clone and build
needs:
- start-runner # required to get output from the start-runner job
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch latest febio-sdk
run: |
ci/linux/febio-sdk.sh
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Build
run: |
ci/linux/build.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: febiostudio2-${{runner.os}}-${{runner.arch}}
path: |
cmbuild/bin
cmbuild/lib
repo-artifacts:
name: Upload artifacts to repo
needs:
- build # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: febiostudio2-${{runner.os}}-${{runner.arch}}
path: |
cmbuild
- name: Configure SSH
run: |
ci/linux/configure-ssh.sh
env:
SSH_USER: ${{ secrets.REPO_USER }}
SSH_KEY: ${{ secrets.REPO_KEY }}
SSH_HOST: ${{ secrets.REPO_HOST }}
- name: Stage Build to Repo
run: |
scp cmbuild/bin/* repo:~/update2/FEBioStudio2Dev/Linux/stage/bin
ssh repo "chmod +x update2/FEBioStudio2Dev/Linux/stage/bin/FEBioStudio"
- name: Make Dev Release
run: |
ssh repo "python3 update2/FEBioStudio2Dev/makeDevRelease.py -l"
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner # required to get output from the start-runner job
- build # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Stop EC2 runner
uses: tundranerd/ec2-multiple-github-runners@multi-os-multi-runner
with:
mode: stop
os: ${{ env.OS }}
wait-for-deregistry-timeout: 5
github-token: ${{ secrets.GH_TOKEN}}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}