0.4.3 #92
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: Publish | |
on: | |
release: | |
types: [published] | |
workflow_call: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
publish-packages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore "./Synapse.sln" | |
- name: Build | |
run: dotnet build "./Synapse.sln" --configuration Release --no-restore | |
- name: Push1 | |
run: dotnet nuget push "./src/*/*/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Push2 | |
run: dotnet nuget push "./src/*/*/*/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
publish-server-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: ${{ env.REGISTRY }}/${{ github.repository }} | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
file: './src/apps/Synapse.Server/Dockerfile' | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
publish-worker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: ${{ env.REGISTRY }}/${{ github.repository }}-worker | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
file: './src/apps/Synapse.Worker/Dockerfile' | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
publish-server-bin: | |
name: Release Server Binaries | |
strategy: | |
matrix: | |
kind: ['linux', 'windows', 'macOS'] | |
include: | |
- kind: linux | |
os: ubuntu-latest | |
target: linux-x64 | |
- kind: windows | |
os: windows-latest | |
target: win-x64 | |
- kind: macOS | |
os: macos-latest | |
target: osx-x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
shell: bash | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
release_name="synapse-${{ matrix.target }}" | |
# Publish | |
dotnet publish src/apps/Synapse.Server/Synapse.Server.csproj --runtime "${{ matrix.target }}" -c Release -o "$release_name" | |
# Pack | |
if [ "${{ matrix.target }}" == "win-x64" ]; then | |
# Pack for Windows | |
7z a -tzip "${release_name}.zip" "./${release_name}/*" | |
else | |
# Pack for other OS | |
tar czvf "${release_name}.tar.gz" "$release_name" | |
fi | |
# Delete output directory | |
rm -r "$release_name" | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "synapse*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-worker-bin: | |
name: Release Worker Binaries | |
strategy: | |
matrix: | |
kind: ['linux', 'windows', 'macOS'] | |
include: | |
- kind: linux | |
os: ubuntu-latest | |
target: linux-x64 | |
- kind: windows | |
os: windows-latest | |
target: win-x64 | |
- kind: macOS | |
os: macos-latest | |
target: osx-x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
shell: bash | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
release_name="synapse-worker-${{ matrix.target }}" | |
# Publish | |
dotnet publish src/apps/Synapse.Worker/Synapse.Worker.csproj --runtime "${{ matrix.target }}" -c Release -o "$release_name" -p:PublishSingleFile=true | |
# Pack | |
if [ "${{ matrix.target }}" == "win-x64" ]; then | |
# Pack for Windows | |
7z a -tzip "${release_name}.zip" "./${release_name}/*" | |
else | |
# Pack for other OS | |
tar czvf "${release_name}.tar.gz" "$release_name" | |
fi | |
# Delete output directory | |
rm -r "$release_name" | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "synapse-worker*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-cli-bin: | |
name: Release CLI Binaries | |
strategy: | |
matrix: | |
kind: ['linux', 'windows', 'macOS'] | |
include: | |
- kind: linux | |
os: ubuntu-latest | |
target: linux-x64 | |
- kind: windows | |
os: windows-latest | |
target: win-x64 | |
- kind: macOS | |
os: macos-latest | |
target: osx-x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
shell: bash | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
release_name="synctl-${{ matrix.target }}" | |
# Publish | |
dotnet publish src/apps/Synapse.Cli/Synapse.Cli.csproj --runtime "${{ matrix.target }}" -c Release -o "$release_name" -p:PublishSingleFile=true -p:GenerateDocumentationFile=false | |
# Pack | |
if [ "${{ matrix.target }}" == "win-x64" ]; then | |
# Pack for Windows | |
7z a -tzip "${release_name}.zip" "./${release_name}/*" | |
else | |
# Pack for other OS | |
tar czvf "${release_name}.tar.gz" "$release_name" | |
fi | |
# Delete output directory | |
rm -r "$release_name" | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "synctl*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-eventstore-plugin: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
shell: bash | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
release_name="EventStoreRepositoryPlugin" | |
# Publish | |
dotnet publish src/plugins/persistence/Synapse.Plugins.Persistence.EventStore/Synapse.Plugins.Persistence.EventStore.csproj -c Release -o "${release_name}" | |
# Pack | |
tar czvf "${release_name}.tar.gz" "${release_name}" | |
# Delete output directory | |
rm -r "${release_name}" | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "EventStoreRepositoryPlugin*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-mongodb-plugin: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
shell: bash | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
release_name="MongoDBRepositoryPlugin" | |
# Publish | |
dotnet publish src/plugins/persistence/Synapse.Plugins.Persistence.MongoDB/Synapse.Plugins.Persistence.MongoDB.csproj -c Release -o "${release_name}" | |
# Pack | |
tar czvf "${release_name}.tar.gz" "${release_name}" | |
# Delete output directory | |
rm -r "${release_name}" | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "MongoDBRepositoryPlugin*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |