Skip to content

Commit e4f18b5

Browse files
committed
Update Actions for all OS to restructure S3 bucket deployment
1 parent bfa69a3 commit e4f18b5

3 files changed

Lines changed: 27 additions & 24 deletions

File tree

.github/workflows/linux_build_deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ jobs:
7272
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
7373
aws-region: ${{ env.AWS_REGION }}
7474

75+
- name: Get branch names
76+
id: branch-name
77+
uses: tj-actions/branch-names@v7
78+
7579
- name: Store DMG on AWS
7680
run: |
7781
cd $GITHUB_WORKSPACE
7882
ls
79-
export CURRENT_BRANCH=`git branch --show-current`
80-
export GUI_COMMIT_TIME=`cat temp/timestamp.txt`
81-
export GUI_VERSION_STRING=`cat temp/versionstring.txt`
82-
echo $GUI_COMMIT_TIME
83-
echo $GUI_VERSION_STRING
83+
CURRENT_BRANCH=${{ steps.branch-name.outputs.head_ref_branch }}
8484
echo $CURRENT_BRANCH
8585
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
86-
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
86+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${CURRENT_BRANCH} --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
8787
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_linux64.zip"

.github/workflows/mac_build_deploy.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ env:
1616

1717
jobs:
1818
build:
19-
name: Test Build for macOS
20-
if: github.event_name != 'workflow_dispatch'
19+
name: Build for macOS
2120
runs-on: macos-latest
2221

2322
steps:
@@ -98,17 +97,17 @@ jobs:
9897
with:
9998
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
10099
aws-region: ${{ env.AWS_REGION }}
100+
101+
- name: Get branch names
102+
id: branch-name
103+
uses: tj-actions/branch-names@v7
101104

102105
- name: Store DMG on AWS S3
103106
run: |
104107
cd $GITHUB_WORKSPACE
105108
ls
106-
export CURRENT_BRANCH=`git branch --show-current`
107-
export GUI_COMMIT_TIME=`cat temp/timestamp.txt`
108-
export GUI_VERSION_STRING=`cat temp/versionstring.txt`
109-
echo $GUI_COMMIT_TIME
110-
echo $GUI_VERSION_STRING
109+
CURRENT_BRANCH=${{ steps.branch-name.outputs.head_ref_branch }}
111110
echo $CURRENT_BRANCH
112111
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
113-
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
112+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${CURRENT_BRANCH} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
114113
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"

.github/workflows/windows_build_deploy.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616

1717
jobs:
1818
build:
19-
name: Test Build for Windows
19+
name: Build for Windows
2020
runs-on: windows-2019
2121

2222
steps:
@@ -84,6 +84,8 @@ jobs:
8484
ls
8585
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
8686
set PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64
87+
type nul > temp/versionstring.txt
88+
type nul > temp/timestamp.txt
8789
python %GITHUB_WORKSPACE%\release_script\make-release.py --no-prompts
8890
shell: cmd
8991

@@ -114,16 +116,18 @@ jobs:
114116
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
115117
aws-region: ${{ env.AWS_REGION }}
116118

119+
- name: Get branch names
120+
id: branch-name
121+
uses: tj-actions/branch-names@v7
122+
117123
- name: Store Build on AWS
118124
run: |
119-
cd $GITHUB_WORKSPACE
125+
cd ${{ github.workspace }}
120126
ls
121-
export CURRENT_BRANCH=`git branch --show-current`
122-
export GUI_COMMIT_TIME=`cat temp/timestamp.txt`
123-
export GUI_VERSION_STRING=`cat temp/versionstring.txt`
124-
echo $GUI_COMMIT_TIME
125-
echo $GUI_VERSION_STRING
126-
echo $CURRENT_BRANCH
127+
echo "${{ steps.branch-name.outputs.head_ref_branch }}"
128+
set S3_BRANCH_FOLDER=s3://openbci-public-gui-v6/${{ steps.branch-name.outputs.head_ref_branch }}
129+
echo %S3_BRANCH_FOLDER%
127130
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
128-
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
129-
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
131+
aws s3 cp ${{ github.workspace }}/. %S3_BRANCH_FOLDER% --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
132+
aws s3 cp ${{ github.workspace }}/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
133+
shell: cmd

0 commit comments

Comments
 (0)