зеркало из https://github.com/Azure/aimazure.git
Updated CI removed schedule event and handling release event
This commit is contained in:
Родитель
d46716637d
Коммит
0ba871f740
|
@ -7,9 +7,7 @@ on:
|
|||
branches:
|
||||
- 'main'
|
||||
release:
|
||||
types: [created]
|
||||
schedule:
|
||||
- cron: '0 2 * * 3'
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
ARM_TEMPLATE_TEST_DIR: 'tests/armtemplates'
|
||||
|
@ -33,7 +31,7 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
|
||||
- name: Checkout from main branch
|
||||
if: github.event_name == 'schedule'
|
||||
if: github.event_name == 'release'
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: main
|
||||
|
@ -45,7 +43,7 @@ jobs:
|
|||
run: powershell .\tests\chocolatey\Test-ChocolateyFilePaths.ps1 -templateRootDirectory "..\..\templates\" -chocoCacheOffset 131
|
||||
|
||||
- name: Set the version number suffix
|
||||
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule'
|
||||
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
||||
shell: bash
|
||||
run: |
|
||||
seconds_at_midnight=$(date --utc -d 'today 00:00:00' +"%s")
|
||||
|
@ -75,7 +73,7 @@ jobs:
|
|||
choco pack $f --version=${{ env.VERSION_NUMBER_SEM1 }} --outputdirectory ./${{ env.OUTPUT_DIR }}/${{ env.CHOCO_PACKAGE_OUTPUT_DIR }}
|
||||
done
|
||||
|
||||
- name: Push the Chocolatey package to the internal repo
|
||||
- name: Push the Chocolatey package to the public repo
|
||||
if: github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
|
||||
shell: bash
|
||||
run: |
|
||||
|
@ -93,23 +91,3 @@ jobs:
|
|||
fi
|
||||
done
|
||||
done
|
||||
|
||||
- name: Push the Chocolatey package to the publicly shared repo
|
||||
if: github.event_name == 'schedule'
|
||||
shell: bash
|
||||
run: |
|
||||
find ./${{ env.OUTPUT_DIR }}/${{ env.CHOCO_PACKAGE_OUTPUT_DIR }}/ -name "*.nupkg" |
|
||||
while read f; do
|
||||
retryCount=0
|
||||
while true; do
|
||||
choco push $f -s ${{ env.CHOCO_PACKAGE_REPO_PUBLIC }} -k ${{ secrets.AIM_CHOCO_PUBLIC_REPO_TOKEN }} && break
|
||||
retryCount=$((retryCount+1))
|
||||
if (( "$retryCount" <= ${{ env.SCRIPT_MAX_RETRIES }} )); then
|
||||
echo "Retrying the processing of $f"
|
||||
sleep ${{ env.SCRIPT_RETRY_SLEEP_IN_SECONDS }}
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче