diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml deleted file mode 100644 index ec9da9d7..00000000 --- a/.github/workflows/common.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish to nuget -on: - push: - tags: - - 'v*' - -jobs: - publish: - name: build, pack & publish - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # Publish - - name: publish on version change - id: publish_nuget - uses: rohith/publish-nuget@v2 - with: - PROJECT_FILE_PATH: Kyoo.Common/Kyoo.Common.csproj - PACKAGE_NAME: Kyoo.Common - NUGET_KEY: ${{secrets.NUGET_API_KEY}} - INCLUDE_SYMBOLS: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..3baaa751 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Release + +on: + create: + tags: + - v* + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Wait for builds & tests to finish + uses: lewagon/wait-on-check-action@v0.2 + with: + ref: ${{github.ref}} + repo-token: ${{secrets.GITHUB_TOKEN}} + running-workflow-name: release + - name: Generate changelog + uses: mikepenz/release-changelog-builder-action@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Download artifacts + uses: dawidd6/action-download-artifact@v2 + with: + commit: ${{github.ref}} + workflow: build.yml + path: ./artifacts + github_token: ${{secrets.GITHUB_TOKEN}} + - name: Public the common to nuget + id: publish_nuget + uses: rohith/publish-nuget@v2 + with: + PROJECT_FILE_PATH: Kyoo.Common/Kyoo.Common.csproj + PACKAGE_NAME: Kyoo.Common + NUGET_KEY: ${{secrets.NUGET_API_KEY}} + INCLUDE_SYMBOLS: true + - name: Create Release + uses: ncipollo/release-action@v1 + with: + draft: true + release_name: ${{github.ref}} + body: ${{steps.github_release.outputs.changelog}} + arficats: ./artifacts/**/* + token: ${{secrets.GITHUB_TOKEN}} diff --git a/deployment/changelog.json b/deployment/changelog.json new file mode 100644 index 00000000..a52bfdcf --- /dev/null +++ b/deployment/changelog.json @@ -0,0 +1,18 @@ +{ + "categories": [ + { + "title": "## Features", + "labels": ["feature"] + }, + { + "title": "## Fixes", + "labels": ["fix"] + }, + { + "title": "## Web App", + "labels": ["webapp"] + } + ], + "template": "${{CHANGELOG}}\n\n
\nOthers\n\n${{UNCATEGORIZED}}\n
", + "pr_template": "- ${{TITLE}} (PR: #${{NUMBER}})" +} \ No newline at end of file