-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more tidynig; test triggering release workflows
- Loading branch information
Showing
7 changed files
with
174 additions
and
75 deletions.
There are no files selected for viewing
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
# TODO: Also publish .NET Binaries | ||
|
||
# This workflow is used for any merge to main and results in a built container image being pushed and tagged as a dev release | ||
# with commit hash and timestamp tags | ||
# | ||
# These are not stable or pre-release semver releases! | ||
name: Publish a Relay Dev Release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- app/Hutch.Relay/** | ||
- test/Hutch.Relay.Tests/** | ||
- .github/workflows/release.Hutch.Relay.yml | ||
|
||
pull_request: # TODO: Testing only | ||
|
||
env: | ||
project: ./app/Hutch.Relay | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
DOTNET_NOLOGO: true | ||
|
||
jobs: | ||
publish-binaries: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
build-config: release | ||
dotnet-version: 9.0.x | ||
publish-dir: publish | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- artifact: win-x64 | ||
args: >- | ||
-r win-x64 | ||
-p:PublishSingleFile=true | ||
-p:IncludeNativeLibrariesInSingleFile=true | ||
--self-contained | ||
- artifact: linux-x64 | ||
args: >- | ||
-r linux-x64 | ||
-p:PublishSingleFile=true | ||
-p:IncludeNativeLibrariesInSingleFile=true | ||
--self-contained | ||
- artifact: dotnet | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.dotnet-version }} | ||
|
||
- name: dotnet publish | ||
run: >- | ||
dotnet publish | ||
${{ env.project }} | ||
-c ${{ env.build-config }} | ||
-o ${{ env.publish-dir }} | ||
${{ matrix.args }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: hutch-relay_${{ matrix.artifact == 'dotnet' && format('{0}-{1}', matrix.artifact, env.dotnet-version) || matrix.artifact }} | ||
path: ${{ env.publish-dir }} | ||
|
||
# Publish platform native EF Core migrations bundles | ||
publish-migrations: | ||
needs: [init] | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
output-filename: migrate-relay-db | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- artifact: win-x64 | ||
file-extension: ".exe" | ||
args: >- | ||
-r win-x64 | ||
- artifact: linux-x64 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.dotnet-version }} | ||
- run: dotnet tool restore | ||
|
||
- run: >- | ||
dotnet ef migrations bundle | ||
-p ${{ env.project }} | ||
-s ${{ env.project }} | ||
-o ${{ format('{0}{1}', env.output-filename, matrix.file-extension) }} | ||
${{ matrix.args }} | ||
--self-contained | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ format('migrations-{0}_{1}', needs.init.outputs.version, matrix.artifact) }} | ||
path: ${{ format('{0}{1}', env.output-filename, matrix.file-extension) }} | ||
|
||
# Publish Edge Container Image to GHCR | ||
publish-containers: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
|
||
env: | ||
image-name: hutch/relay | ||
repo-owner: ${{ github.repository_owner }} | ||
registry: ghcr.io | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ${{ env.registry }} | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: Set timestamp env var | ||
run: echo "RUN_TIMESTAMP=$(TZ="Etc/UTC" date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV | ||
|
||
- name: Docker Metadata action | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ${{ env.registry }}/${{ env.repo-owner}}/${{ env.image-name}} | ||
tags: | | ||
${{ github.sha }} | ||
${{ env.RUN_TIMESTAMP }} | ||
dev-latest | ||
- name: Build and push Docker images | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: app/Hutch.Relay/Dockerfile | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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