Skip to content

Commit 303bfd7

Browse files
committed
overhauling release pipeline
1 parent 13782df commit 303bfd7

2 files changed

Lines changed: 56 additions & 26 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Release build
22

33
env:
44
OUTPUT_PATH: ${{ github.workspace }}/.nupkg
5-
DOTNET_VERSION: "5.0.101"
5+
DOTNET_VERSION: "5.0.201"
66
GITHUB_SOURCE: "https://nuget.pkg.github.com/aaronpowell/index.json"
77
NUGET_SOURCE: "https://api.nuget.org/v3/index.json"
88

@@ -34,15 +34,8 @@ jobs:
3434
name: packages
3535
path: ${{ env.OUTPUT_PATH }}
3636

37-
publish-release:
38-
needs: build
39-
runs-on: ubuntu-latest
37+
- run: echo "tag=${GITHUB_REF##*/v}" >> $GITHUB_ENV
4038

41-
steps:
42-
- uses: actions/download-artifact@v2
43-
with:
44-
name: packages
45-
path: ${{ env.OUTPUT_PATH }}
4639
- name: Create Release
4740
id: create_release
4841
uses: actions/create-release@v1
@@ -51,52 +44,83 @@ jobs:
5144
with:
5245
tag_name: ${{ github.ref }}
5346
release_name: Release ${{ github.ref }}
54-
draft: false
47+
draft: true
5548
prerelease: false
5649
body_path: ${{ env.OUTPUT_PATH }}/changelog.md
50+
- run: echo ${{ steps.create_release.outputs.id }} >> release.txt
51+
- name: Upload
52+
uses: actions/upload-artifact@v2
53+
with:
54+
name: release_id
55+
path: release.txt
56+
5757
- name: Upload NuGet package
5858
uses: actions/upload-release-asset@v1
5959
env:
6060
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6161
with:
62-
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
63-
asset_path: FSharp.CosmosDb.${{ github.ref }}.nupkg
64-
asset_name: FSharp.CosmosDb.${{ github.ref }}.nupkg
62+
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
63+
asset_path: ${{ env.OUTPUT_PATH }}/FSharp.CosmosDb.${{ env.tag }}.nupkg
64+
asset_name: FSharp.CosmosDb.${{ env.tag }}.nupkg
6565
asset_content_type: application/zip
6666

67-
- name: Upload NuGet package (analyzer)
67+
- name: Upload NuGet package (Licensing)
6868
uses: actions/upload-release-asset@v1
6969
env:
7070
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7171
with:
72-
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
73-
asset_path: FSharp.CosmosDb.Analyzer.${{ github.ref }}.nupkg
74-
asset_name: FSharp.CosmosDb.Analyzer.${{ github.ref }}.nupkg
72+
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
73+
asset_path: ${{ env.OUTPUT_PATH }}/FSharp.CosmosDb.Analyzer.${{ env.tag }}.nupkg
74+
asset_name: FSharp.CosmosDb.Analyzer.${{ env.tag }}.nupkg
7575
asset_content_type: application/zip
7676

7777
- name: Upload NuGet symbol package
7878
uses: actions/upload-release-asset@v1
7979
env:
8080
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8181
with:
82-
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
83-
asset_path: FSharp.CosmosDb.${{ github.ref }}.snupkg
84-
asset_name: FSharp.CosmosDb.${{ github.ref }}.snupkg
82+
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
83+
asset_path: ${{ env.OUTPUT_PATH }}/FSharp.CosmosDb.${{ env.tag }}.snupkg
84+
asset_name: FSharp.CosmosDb.${{ env.tag }}.snupkg
8585
asset_content_type: application/zip
8686

87-
- name: Upload NuGet symbol package (analyzer)
87+
- name: Upload NuGet symbol package (Licensing)
8888
uses: actions/upload-release-asset@v1
8989
env:
9090
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9191
with:
92-
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
93-
asset_path: FSharp.CosmosDb.Analyzer.${{ github.ref }}.snupkg
94-
asset_name: FSharp.CosmosDb.Analyzer.${{ github.ref }}.snupkg
92+
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
93+
asset_path: ${{ env.OUTPUT_PATH }}/FSharp.CosmosDb.Analyzer.${{ env.tag }}.snupkg
94+
asset_name: FSharp.CosmosDb.Analyzer.${{ env.tag }}.snupkg
9595
asset_content_type: application/zip
9696

97-
publish-github:
97+
publish-release:
9898
needs: build
9999
runs-on: ubuntu-latest
100+
environment:
101+
name: release
102+
103+
steps:
104+
- name: Download package
105+
uses: actions/download-artifact@v2
106+
with:
107+
name: release_id
108+
- run: echo "release_id=$(cat release.txt)" >> $GITHUB_ENV
109+
- name: Publish release
110+
uses: actions/github-script@v3
111+
with:
112+
github-token: ${{secrets.GITHUB_TOKEN}}
113+
script: |
114+
github.repos.updateRelease({
115+
owner: context.repo.owner,
116+
repo: context.repo.repo,
117+
release_id: process.env.release_id,
118+
draft: false
119+
})
120+
121+
publish-github:
122+
needs: publish-release
123+
runs-on: ubuntu-latest
100124

101125
steps:
102126
- uses: actions/download-artifact@v2
@@ -118,7 +142,7 @@ jobs:
118142
working-directory: ${{ env.OUTPUT_PATH }}
119143

120144
publish-nuget:
121-
needs: build
145+
needs: publish-release
122146
runs-on: ubuntu-latest
123147

124148
steps:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog for `FSharp.CosmosDb`
22

3+
## [0.5.1] - 2021-04-09
4+
5+
### Fixed
6+
7+
- Overhaul of release pipeline
8+
39
## [0.5.0] - 2021-04-09
410

511
### Added

0 commit comments

Comments
 (0)