Skip to content

Commit

Permalink
Start ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
ghsales committed Sep 28, 2024
1 parent 85e3bc2 commit eb605ae
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 3 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish Nuget Packages

on:
push:
tags:
- '*.*.**'
jobs:
publish_nuget_package:
name: Publish SSync Client
runs-on: ubuntu-latest
steps:

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x

# project ssync client

- uses: actions/checkout@v4
- name: Set Version Client
run: |
set -i -e 's/{{Version}}/${{github.ref_name}}/' ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj
- name: Restore Client
run: dotnet restore ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj

- name: Build Client
run: dotnet build --no-restore ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj


- name: Test Client
run: dotnet test --no-build --verbosity normal ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj

- name: Pack Client
run: |
dotnet pack ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj -c Release -o .output-client
# - name: Publish Client
# env:
# API_KEY: ${{ secrets.NUGET_API_KEY_CLIENT }}
# run: |
# dotnet nuget push output-client/*.nupkg --api-key $API_KEY --source -s https://api.nuget.org/v3/index.json --skip-duplicate

# end project ssync client

# project ssync server

- uses: actions/checkout@v4
- name: Set Version Server
run: |
set -i -e 's/{{Version}}/${{github.ref_name}}/' ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj
- name: Restore Server
run: dotnet restore ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj

- name: Build Server
run: dotnet build --no-restore ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj


- name: Test Server
run: dotnet test --no-build --verbosity normal ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj

- name: Pack Server
run: |
dotnet pack ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj -c Release -o .output-server
# - name: Publish Server
# env:
# API_KEY: ${{ secrets.NUGET_API_KEY_SERVER }}
# run: |
# dotnet nuget push output-server/*.nupkg --api-key $API_KEY --source -s https://api.nuget.org/v3/index.json --skip-duplicate

# end project ssync server

Empty file removed .github/workflows/publish.yml
Empty file.
2 changes: 1 addition & 1 deletion SSync.LiteDB.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SSync.Server.LitebDB.Tests"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36F96630-08DF-4386-AADB-C8E121988D5B}"
ProjectSection(SolutionItems) = preProject
.github\workflows\publish.yml = .github\workflows\publish.yml
readme.md = readme.md
.github\workflows\publish.yaml = .github\workflows\publish.yaml
EndProjectSection
EndProject
Global
Expand Down
2 changes: 1 addition & 1 deletion src/SSync.Client.LitebDB/SSync.Client.LitebDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>

<PackageId>SSync.Client.LitebDB</PackageId>
<Version>1.0.0-alpha.1</Version>
<Version>{{Version}}</Version>
<Authors>Gabriel Sales</Authors>
<Copyright>MIT</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
2 changes: 1 addition & 1 deletion src/SSync.Server.LitebDB/SSync.Server.LitebDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


<PackageId>SSync.Server.LitebDB</PackageId>
<Version>1.0.0-alpha.1</Version>
<Version>{{Version}}</Version>
<Authors>Gabriel Sales</Authors>
<Copyright>MIT</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down

0 comments on commit eb605ae

Please sign in to comment.