-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from pkuehnel/develop
Feat/cicd (#34)
- Loading branch information
Showing
3 changed files
with
154 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
name: versionRelease | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
releaseFiles: | ||
name: Release | ||
strategy: | ||
matrix: | ||
kind: ['linux-x64', 'linux-arm64'] | ||
include: | ||
- kind: linux-x64 | ||
os: ubuntu-latest | ||
target: linux-x64 | ||
- kind: linux-arm64 | ||
os: ubuntu-latest | ||
target: linux-arm64 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 6.0.x | ||
|
||
- name: Build SmartTeslaAmpSetter | ||
shell: bash | ||
run: | | ||
# Define some variables for things we need | ||
tag=$(git describe --tags --abbrev=0) | ||
release_name="SmartTeslaAmpSetter-$tag-${{ matrix.target }}" | ||
# Build everything | ||
dotnet publish SmartTeslaAmpSetter/Server/SmartTeslaAmpSetter.Server.csproj --runtime "${{ matrix.target }}" -c Release -o "$release_name" | ||
# Pack files | ||
tar czvf "${release_name}.tar.gz" "$release_name" | ||
# Delete output directory | ||
rm -r "$release_name" | ||
- name: Build Plugins.SmaEnergymeter | ||
shell: bash | ||
run: | | ||
# Define some variables for things we need | ||
tag=$(git describe --tags --abbrev=0) | ||
release_name="Plugins.SmaEnergymeter-$tag-${{ matrix.target }}" | ||
# Build everything | ||
dotnet publish Plugins.SmaEnergymeter/Plugins.SmaEnergymeter.csproj --runtime "${{ matrix.target }}" -c Release -o "$release_name" | ||
# Pack files | ||
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: "*.tar.gz" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
releaseDockerLatestSmartTeslaAmpSetter: | ||
name: Building SmartTeslaAmpSetter image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
pkuehnel/smartteslaampsetter | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=semver,pattern={{version}} | ||
- name: Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: DockerHub login | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASS}} | ||
|
||
- name: Build and push SmartTeslaAmpSetter | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: ./SmartTeslaAmpSetter/Server/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
releaseDockerLatestSmaEnergymeterplugin: | ||
name: Building SMAPlugin Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
pkuehnel/smartteslaampsettersmaplugin | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=semver,pattern={{version}} | ||
- name: Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: DockerHub login | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASS}} | ||
|
||
- name: Build and push SmaPlugin | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: ./Plugins.SmaEnergymeter/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} |
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,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"dotnet-ef": { | ||
"version": "6.0.3", | ||
"commands": [ | ||
"dotnet-ef" | ||
] | ||
} | ||
} | ||
} |