Skip to content

Commit

Permalink
feat: publish prereelase packages to GitHub packages
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih committed Jan 13, 2024
1 parent 6476473 commit 2d40897
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,29 @@ jobs:
with:
commit_message: 'test(snapshot): update snapshots ${{ github.sha }} for ${{ matrix.os }}'

publish-github-packages:
if: github.ref == 'refs/heads/main'
needs: [test, snapshot]
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
with:
depth: 0

- id: version
uses: paulhatch/[email protected]

- uses: ./.github/actions/build

- name: dotnet pack
run: dotnet pack -c Release /p:Version=${{ steps.versioning.outputs.version }} -o drop/nuget

- name: dotnet nuget push
run: |
dotnet nuget push drop/nuget/*.nupkg --api-key "${{ secrets.NUGET_KEY }}" --skip-duplicate --source https://api.nuget.org/v3/index.json
publish-docs:
if: github.ref == 'refs/heads/main'
needs: [test, snapshot]
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.x
- run: npm install
working-directory: templates

- run: npm run lint
working-directory: templates

- run: npm run build
working-directory: templates
- uses: ./.github/actions/build

- name: dotnet pack
run: dotnet pack -c Release /p:Version=${GITHUB_REF_NAME#v} -o drop/nuget
Expand Down

0 comments on commit 2d40897

Please sign in to comment.