forked from BlueFinBima/Helios14
-
Notifications
You must be signed in to change notification settings - Fork 41
117 lines (99 loc) · 4.98 KB
/
Copy pathTesterCopy.yml
File metadata and controls
117 lines (99 loc) · 4.98 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
name: 2a. Tester Access to Zip files held in Cache
# This workflow needs to be triggered manually on a Release Candidate branch which has
# a name in the form "rc16nnn". The workflow attempts to find a valid cache containng
# the installer files built by the pre-release Build workflow, and then it copies the
# zip containing the installers to the assets section of this workflow's action output.
#
# Correct Tag and Branch naming conversions are critical to the success of this workflow.
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
NewTag: "1.6.1000.0"
CurrentBranch: "master"
if: ${{ contains(github.ref,'rc16') }}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
fetch-depth: 0
- name: Find Current Tag
run: |
currentTag=$(git describe --tags)
currentBranch=$(git rev-parse --abbrev-ref HEAD)
if [ ${currentBranch:0:4} != "rc16" ];then
# Force an Exit
echo "Error: This workflow must be run on a release candidate branch with a case sensitive name beginning with \"rc16\"."
echo " The current branch name is \"${currentBranch}\"."
exit 99 # ForceJobExit due to workflow being run on the wrong branch
fi
echo "CurrentBranch=${currentBranch}" >> $GITHUB_ENV
# Expecting the current Tag to be of form "#.#.####.###-####-?????????"
echo "Current Tag: \"$currentTag\" is expected to be in the form \"#.#.####.###-####-?????????\". "
CurrentTag=$(git tag -l sort=committerdate 1.6.${currentBranch:4}?.* | sort -r | head -1)
# latestTag=$(git tag -l 1.6.${currentBranch:4}?.* | sort -V | head -1)
echo "Current Tag: \"$CurrentTag\""
if [[ $CurrentTag != "1.6.${currentBranch:4}"* ]];then
# Force an Exit
echo "Error: The most recent tag \"$CurrentTag\" for this branch is invalid or at best unexpected."
echo " The current branch name is \"${currentBranch}\"."
exit 99 # ForceJobExit due to workflow being run on the wrong branch
fi
echo "CurrentTag=${CurrentTag}" >> $GITHUB_ENV
# echo "New Tag: ${currentTag:0:8}.$(($(cut -d\- -f1 <<<${currentTag:9})+1))"
# echo "NewTag=${currentTag:0:8}.$(($(cut -d\- -f1 <<<${currentTag:9})+1))" >> $GITHUB_ENV
# Find the previous release's most recent Tag, by decrementing the last 3 digits of the current branch name
# this requires that the branch names are sequential, and don't miss a release.
echo "${currentBranch:2}"
echo "$((${currentBranch:4}-1))"
CheckTags=$(git tag -l sort=committerdate 1.6.$((${currentBranch:4}-1))?.* | sort -r | tail -1)
echo "PreviousTag=${CheckTags}" >> $GITHUB_ENV
- name: Display the version number
run: |
echo "Current Tag: ${{ env.CurrentTag }}"
echo "Previous Tag: ${{ env.PreviousTag }}"
echo "current Branch from ref: ${{github.ref}}"
echo "current Branch: ${{ env.CurrentBranch }}"
mkdir -p ./Assets
- uses: actions/cache@v3
id: installer-cache
with:
path: ./Assets
key: Helios-installers-${{ env.CurrentTag }}
enableCrossOsArchive: true
- if: ${{ steps.installer-cache.outputs.cache-hit != 'true' }}
name: Exit Due to Inability to find valid cache from Build
run: |
# Force an Exit
echo "Error: This workflow requires installer files cached by a valid Pre-Release build workflow."
echo " Exiting because cache \"Helios-installers-${{ env.NewTag }}\" could not be found."
exit 99 # ForceJobExit due to workflow not finding installer cache
- if: ${{ steps.installer-cache.outputs.cache-hit == 'true' }}
name: Display structure of installer files recovered from cache
run: |
ls -R
working-directory: ./Assets
- name: Upload Helios_Installers 1
uses: actions/upload-artifact@v4
with:
name: Helios ${{ env.CurrentTag }} Release Candidate 64Bit Installers
path: "./Assets/Helios_Installers.zip"
retention-days: 7
- name: Upload Helios_Installers 2
uses: actions/upload-artifact@v4
with:
name: Helios ${{ env.CurrentTag }} Release Candidate 32Bit Installers
path: "./Assets/Helios32Bit_Installers.zip"
retention-days: 7
- name: Upload Helios_Installers 3
uses: actions/upload-artifact@v4
with:
name: Helios ${{ env.CurrentTag }} Release Candidate Stream Deck Installer
path: "./Assets/Helios_StreamDeck_Alpha.zip"
retention-days: 7