Skip to content

Commit

Permalink
Merge pull request #6 from 345paul/feat/update-ci
Browse files Browse the repository at this point in the history
Updated CI removed schedule event and handling release event
  • Loading branch information
probertdaniel authored Oct 27, 2020
2 parents d467166 + 0ba871f commit a9c071c
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ on:
branches:
- 'main'
release:
types: [created]
schedule:
- cron: '0 2 * * 3'
types: [published]

env:
ARM_TEMPLATE_TEST_DIR: 'tests/armtemplates'
Expand All @@ -32,8 +30,8 @@ jobs:
if: github.event_name == 'push' || github.event_name == 'pull_request'
uses: actions/checkout@v2

- name: Checkout from main branch
if: github.event_name == 'schedule'
- name: Checkout from main branch
if: github.event_name == 'release'
uses: actions/checkout@v2
with:
ref: main
Expand All @@ -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")
Expand Down Expand Up @@ -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: |
Expand All @@ -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

0 comments on commit a9c071c

Please sign in to comment.