Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Component Detection CI

on:
on:
push:
branches:
branches:
- main
pull_request:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to remove pull_request and workflow_dispatch, PRs already have their workflow to build and just run tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the real fix, I will follow up with a PR to remove them :D

release:
types:
- published
workflow_dispatch:

jobs:
build:
Expand Down Expand Up @@ -38,17 +43,9 @@ jobs:
- name: Tar the output
run: tar -C ./dist -cvf ./dist-release/component-detection.tar.gz .

- name: Create a release draft
id: create_release_draft
uses: release-drafter/release-drafter@v5
with:
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Extension Release Asset
id: upload-component-detection-release-asset
if: startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -59,18 +56,18 @@ jobs:
asset_content_type: application/zip

- name: Add NuGet publication source for Github packages
if: startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'release'
run: dotnet nuget add source https://nuget.pkg.github.com/microsoft/index.json --password $GITHUB_TOKEN --username notused --store-password-in-clear-text --name cgwriter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate NuGet packages
if: startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'release'
run: dotnet pack -o dist-nuget -c Release

# dotnet nuget push seems to have some probs, use curl for GH
- name: Publish nuget
if: startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'release'
run: |
for f in ./dist-nuget/*.nupkg
do
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release Drafter

on:
push:
branches:
- main
workflow_dispatch:

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}