Skip to content

Quick Fix for #167 #186

Quick Fix for #167

Quick Fix for #167 #186

Workflow file for this run

name: CI
on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- master
# release:
# types: [prereleased, edited]
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore packages
run: dotnet restore src
- name: Test
run: dotnet test src --configuration Release
build:
name: Create Package nuget
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.event.created == true && github.event.compare != '' && github.ref != ''
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Get the version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore packages
run: dotnet restore src
- name: Build and create package nuget
run: dotnet pack src -c Release -p:PackageVersion=${{steps.vars.outputs.tag}}
- name: Publish artifact
uses: actions/upload-artifact@master
with:
name: Netatmo.${{steps.vars.outputs.tag}}.nupkg
path: src/Netatmo/bin/Release/Netatmo.${{steps.vars.outputs.tag}}.nupkg
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{steps.vars.outputs.tag}}
release_name: Release ${{steps.vars.outputs.tag}}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: src/Netatmo/bin/Release/Netatmo.${{steps.vars.outputs.tag}}.nupkg
asset_name: Netatmo.${{steps.vars.outputs.tag}}.nupkg
asset_content_type: application/zip
- name: Push package
run: dotnet nuget push src/Netatmo/bin/Release/Netatmo.${{steps.vars.outputs.tag}}.nupkg -k ${{ secrets.NUGET_ORG_KEY }} -s https://api.nuget.org/v3/index.json