-
Notifications
You must be signed in to change notification settings - Fork 35
90 lines (75 loc) · 2.75 KB
/
tag.yaml
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
name: Build and push new version
on:
create:
jobs:
build_push_docker:
name: Build and Push Docker image
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: get_version
name: Format docker image tag
uses: battila7/get-version-action@v2
- id: repository_owner
name: Format repository owner
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.repository_owner }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push new docker image
uses: docker/build-push-action@v5
with:
push: true
context: ./src
file: ./src/Dockerfile
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/oidc-server-mock:latest
ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/oidc-server-mock:${{ steps.get_version.outputs.version-without-v }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
build_push_nuget:
name: Build and Push Nuget package
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
defaults:
run:
working-directory: src
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dotnet-version: '8.0'
ui-url: https://raw.githubusercontent.com/DuendeSoftware/IdentityServer.Quickstart.UI/main/getmain.sh
steps:
- uses: actions/checkout@v4
- name: Download UI
run: curl -L ${{ env.ui-url }} | bash
- name: Setup .NET Core SDK ${{ env.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet-version }}
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
- name: Install dependencies
run: dotnet restore
- id: get_version
name: Format nuget package version
uses: battila7/get-version-action@v2
- name: Build Nuget package
run: |
dotnet pack --no-restore --configuration Release \
/p:VersionPrefix=${{ steps.get_version.outputs.version-without-v }} \
/p:RepositoryCommit=${{ github.sha }}
- name: Push Nuget package
run: dotnet nuget push bin/Release/*.nupkg -k ${{ env.NUGET_AUTH_TOKEN }}