Skip to content

Commit

Permalink
Temp changes to publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Nov 13, 2023
1 parent 43dd2d4 commit 9716059
Showing 1 changed file with 76 additions and 77 deletions.
153 changes: 76 additions & 77 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
name: Publish Release
"on": workflow_dispatch
jobs:
main:
runs-on: windows-latest
environment: Production
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Download all artifacts
uses: dawidd6/action-download-artifact@46b4ae883bf0726f5949d025d31cb62c7a5ac70c
with:
workflow: pr.yml
commit: ${{ github.sha }}
path: ${{ github.workspace }}
workflow_conclusion: completed
- name: Read version
id: get-version
run: |
cd Packages
pkgVersion=$(find . -type f -regex ".*Realm\.LFS\.[1-9].*.nupkg" -exec basename {} \; | sed -n 's/Realm\.LFS\.\(.*\)\.nupkg$/\1/p')
echo "version=$pkgVersion" >> $GITHUB_OUTPUT
shell: bash
- name: Publish packages
run: |
dotnet nuget push ${{ github.workspace }}/Packages/Realm.LFS.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
dotnet nuget push ${{ github.workspace }}/Packages/Realm.LFS.Azure.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
dotnet nuget push ${{ github.workspace }}/Packages/Realm.LFS.Functions.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
dotnet nuget push ${{ github.workspace }}/Packages/Realm.LFS.S3.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- name: Find Release PR
uses: juliangruber/find-pull-request-action@afdd62ccd2d4c55f5bdb154b489b85fc4cbcb9c1
id: find-pull-request
with:
branch: ${{ github.ref }}
- name: Merge Pull Request
uses: juliangruber/merge-pull-request-action@333730196b34b74936aad75a4e31c23a57582d14
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.find-pull-request.outputs.number }}
method: squash
- name: Publish Github Release
uses: ncipollo/release-action@3ac4132803a6419fa2a7f4e9dbd1d93fceb690b9
with:
bodyFile: Packages/ExtractedChangelog.md
name: ${{ steps.get-version.outputs.version }}
commit: main
tag: ${{ steps.get-version.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
- name: Update Changelog
run: |
echo "## vNext (TBD)
# main:
# runs-on: windows-latest
# environment: Production
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# - name: Download all artifacts
# uses: dawidd6/action-download-artifact@46b4ae883bf0726f5949d025d31cb62c7a5ac70c
# with:
# workflow: pr.yml
# commit: ${{ github.sha }}
# path: ${{ github.workspace }}
# workflow_conclusion: completed
# - name: Read version
# id: get-version
# run: |
# cd Packages
# pkgVersion=$(find . -type f -regex ".*Realm\.LFS\.[1-9].*.nupkg" -exec basename {} \; | sed -n 's/Realm\.LFS\.\(.*\)\.nupkg$/\1/p')
# echo "version=$pkgVersion" >> $GITHUB_OUTPUT
# shell: bash
# - name: Publish packages
# run: |
# dotnet nuget push ${{ github.workspace }}/Packages/Realm.LFS.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
# dotnet nuget push ${{ github.workspace }}/Packages/Realm.LFS.Azure.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
# dotnet nuget push ${{ github.workspace }}/Packages/Realm.LFS.Functions.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
# dotnet nuget push ${{ github.workspace }}/Packages/Realm.LFS.S3.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
# - name: Find Release PR
# uses: juliangruber/find-pull-request-action@afdd62ccd2d4c55f5bdb154b489b85fc4cbcb9c1
# id: find-pull-request
# with:
# branch: ${{ github.ref }}
# - name: Merge Pull Request
# uses: juliangruber/merge-pull-request-action@333730196b34b74936aad75a4e31c23a57582d14
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# number: ${{ steps.find-pull-request.outputs.number }}
# method: squash
# - name: Publish Github Release
# uses: ncipollo/release-action@3ac4132803a6419fa2a7f4e9dbd1d93fceb690b9
# with:
# bodyFile: Packages/ExtractedChangelog.md
# name: ${{ steps.get-version.outputs.version }}
# commit: main
# tag: ${{ steps.get-version.outputs.version }}
# token: ${{ secrets.GITHUB_TOKEN }}
# draft: false
# - name: Update Changelog
# run: |
# echo "## vNext (TBD)

### Enhancements
* None
# ### Enhancements
# * None

### Fixed
* None
# ### Fixed
# * None

### Internal
* None
" | cat - CHANGELOG.md >> temp
mv temp CHANGELOG.md
shell: bash
- name: Create vNext PR
id: vnext-pr
uses: peter-evans/create-pull-request@6c704eb7a8ba1daa13da0dcea9bb93a4fe530275
with:
branch: prepare-vnext
title: Prepare for vNext
body: Update Changelog for vNext
delete-branch: true
base: main
commit-message: Prepare for vNext
- name: Merge Pull Request
uses: juliangruber/merge-pull-request-action@333730196b34b74936aad75a4e31c23a57582d14
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.vnext-pr.outputs.pull-request-number }}
method: squash
# ### Internal
# * None
# " | cat - CHANGELOG.md >> temp
# mv temp CHANGELOG.md
# shell: bash
# - name: Create vNext PR
# id: vnext-pr
# uses: peter-evans/create-pull-request@6c704eb7a8ba1daa13da0dcea9bb93a4fe530275
# with:
# branch: prepare-vnext
# title: Prepare for vNext
# body: Update Changelog for vNext
# delete-branch: true
# base: main
# commit-message: Prepare for vNext
# - name: Merge Pull Request
# uses: juliangruber/merge-pull-request-action@333730196b34b74936aad75a4e31c23a57582d14
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# number: ${{ steps.vnext-pr.outputs.pull-request-number }}
# method: squash

deploy-docs:
environment:
Expand All @@ -90,7 +90,6 @@ jobs:
pages: write
id-token: write
runs-on: ubuntu-latest
needs: [ main ]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down

0 comments on commit 9716059

Please sign in to comment.