-
-
Notifications
You must be signed in to change notification settings - Fork 37
134 lines (123 loc) · 5.16 KB
/
release.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Release CI
on:
push:
branches: [ main ]
jobs:
build:
name: Build and Push Docker images
runs-on: ubuntu-latest
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
defaults:
run:
working-directory: src
needs: [version]
steps:
- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7
uses: docker/login-action@v1.14.1
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: registry.antosubash.com
# Username used to log against the Docker registry
username: ${{ secrets.REGISTRY_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.REGISTRY_PASSWORD }}
- uses: actions/checkout@v2
- name: Build the Gateway Docker image
run: docker build . --file gateway/Tasky.Gateway/Dockerfile --tag gateway:dev
- name: Docker tag images
run: docker tag gateway:dev registry.antosubash.com/gateway:dev
- name: Push Gateway image
run: docker push registry.antosubash.com/gateway:dev
- name: Build the AuthServer Docker image
run: docker build . --file apps/Tasky.AuthServer/Dockerfile --tag authserver:dev
- name: Docker tag AuthServer images
run: docker tag authserver:dev registry.antosubash.com/authserver:dev
- name: Push AuthServer image
run: docker push registry.antosubash.com/authserver:dev
- name: Build the Administration Docker image
run: docker build . --file services/administration/host/Tasky.Administration.HttpApi.Host/Dockerfile --tag administration:dev
- name: Docker tag Administration images
run: docker tag administration:dev registry.antosubash.com/administration:dev
- name: Push Administration image
run: docker push registry.antosubash.com/administration:dev
- name: Build the IdentityService Docker image
run: docker build . --file services/identity/host/Tasky.IdentityService.HttpApi.Host/Dockerfile --tag identityservice:dev
- name: Docker tag identityservice images
run: docker tag identityservice:dev registry.antosubash.com/identityservice:dev
- name: Push IdentityService image
run: docker push registry.antosubash.com/identityservice:dev
- name: Build the SaaS Docker image
run: docker build . --file services/saas/host/Tasky.SaaS.HttpApi.Host/Dockerfile --tag saas:dev
- name: Docker tag SaaS images
run: docker tag saas:dev registry.antosubash.com/saas:dev
- name: Push SaaS image
run: docker push registry.antosubash.com/saas:dev
- name: Build the DbMigrator Docker image
run: docker build . --file shared/Tasky.DbMigrator/Dockerfile --tag migrator:dev
- name: Docker tag DbMigrator images
run: docker tag migrator:dev registry.antosubash.com/migrator:dev
- name: Push DbMigrator image
run: docker push registry.antosubash.com/migrator:dev
version:
name: Versionize Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install Aspire workload
run: dotnet workload install aspire
- name: Restore dependencies
run: dotnet restore src
- name: Build
run: dotnet build src --no-restore
- name: Install Versionize
run: dotnet tool install --global Versionize
- name: Setup git
run: |
git config --local user.email "antosubash@live.com"
git config --local user.name "Anto Subash"
- name: Versionize Release
id: versionize
run: versionize --changelog-all --exit-insignificant-commits
- name: Push changes to GitHub
if: steps.versionize.outcome == 'success'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: "Create release"
if: steps.versionize.outcome == 'success'
uses: "actions/github-script@v5"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
try {
const tags_url = context.payload.repository.tags_url + "?per_page=1"
const result = await github.request(tags_url)
const current_tag = result.data[0].name
await github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: current_tag,
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: current_tag,
});
} catch (error) {
core.setFailed(error.message);
}
- name: Build Package
if: steps.versionize.outcome == 'success'
run: dotnet pack --output nupkgs --configuration Release
- name: Push to Nuget
if: steps.versionize.outcome == 'success'
run: dotnet nuget push "nupkgs/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate