Bump the all group across 1 directory with 22 updates #108
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'CI' | |
on: | |
push: | |
paths: | |
- src/** | |
- .github/workflows/ci.yaml | |
branches: | |
- main | |
pull_request: | |
paths: | |
- src/** | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: 2frogsstudio/spin-rally-bot | |
ARCHITECTURES: x64,arm64 | |
jobs: | |
build: | |
name: Build, Tests, Publish | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.0' | |
- name: Get Cache Month | |
id: cache-month | |
run: | | |
echo "date=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT | |
shell: bash | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: nuget-${{ steps.cache-month.outputs.date }}-${{ hashFiles('src/Directory.Packages.props') }} | |
restore-keys: | | |
nuget-${{ steps.cache-month.outputs.date }}- | |
- name: Run tests | |
timeout-minutes: 10 | |
working-directory: src | |
run: | | |
dotnet test -c Release --logger "console;verbosity=normal" --logger "trx;LogFilePrefix=results" -m | |
- name: Upload test results trx files | |
uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: test-results | |
path: '**/*.trx' | |
- uses: docker/login-action@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Build, publish image and push manifest | |
if: github.event_name != 'pull_request' | |
working-directory: src | |
run: | | |
archImages="" | |
for arch in $(echo $ARCHITECTURES | sed "s/,/ /g"); do | |
tag=${{ github.sha }}-$arch | |
dotnet publish SpinRallyBot --os linux --arch $arch /t:PublishContainer /p:ContainerRepository="$IMAGE_NAME" /p:ContainerImageTags="$tag" | |
remoteImage=$REGISTRY/$IMAGE_NAME:$tag | |
docker tag $IMAGE_NAME:$tag $remoteImage | |
docker push $remoteImage | |
archImages+=" ${remoteImage}" | |
done | |
docker manifest create $REGISTRY/$IMAGE_NAME:${{ github.sha }} $archImages | |
docker manifest push $REGISTRY/$IMAGE_NAME:${{ github.sha }} | |
docker manifest create $REGISTRY/$IMAGE_NAME:latest $archImages | |
docker manifest push $REGISTRY/$IMAGE_NAME:latest |