forked from aws/aws-xray-sdk-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (103 loc) · 4.54 KB
/
build-pack-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Build-Pack-Release
on:
workflow_dispatch:
inputs:
version:
description: The version to tag the release with, e.g., 1.2.0, 1.3.0
required: true
permissions:
id-token: write
contents: write
jobs:
build-pack-release:
runs-on: windows-latest
env:
DOTNET_MULTILEVEL_LOOKUP: 1
strategy:
fail-fast: true
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Assume role to get .snk file
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN_RELEASE }}
aws-region: us-west-2
# - name: Get Strong-Naming Key
# run: >
# aws s3api get-object
# --bucket ${{ secrets.SNK_BUCKET }}
# --key awsxrayrecorder.dll.snk
# awsxrayrecorder.dll.snk
# - name: Install dependencies
# run: dotnet restore .\sdk\AWSXRayRecorder.sln
# - name: Build solution
# run: >
# dotnet build
# .\sdk\AWSXRayRecorder.sln
# /p:Configuration=Release
# --no-restore
# /p:AssemblyOriginatorKeyFile=${{ github.workspace }}\awsxrayrecorder.dll.snk
# - name: Clean up the snk file
# run: rm .\awsxrayrecorder.dll.snk
# - name: Assume signer role
# uses: aws-actions/configure-aws-credentials@v1
# with:
# role-to-assume: ${{ secrets.AWS_ARTIFACT_ACCESS_ROLE_ARN }}
# aws-region: us-west-2
- name: Invoke Signing script
env:
UNSIGNED_BUCKET: ${{ secrets.AWS_UNSIGNED_BUCKET_NAME }}
SIGNED_BUCKET: ${{ secrets.AWS_SIGNED_BUCKET_NAME }}
#TODO: There is probably a better way to pass in a list of paths as a single parameter to the script.
run: |
.\buildtools\sign_files.ps1 -Filters AWSXRayRecorder.*.dll -Recurse -Path .\sdk\src\Core\bin\Release
.\buildtools\sign_files.ps1 -Filters AWSXRayRecorder.*.dll -Recurse -Path .\sdk\src\Handlers\AspNet\bin\Release
.\buildtools\sign_files.ps1 -Filters AWSXRayRecorder.*.dll -Recurse -Path .\sdk\src\Handlers\AspNetCore\bin\Release
.\buildtools\sign_files.ps1 -Filters AWSXRayRecorder.*.dll -Recurse -Path .\sdk\src\Handlers\AwsSdk\bin\Release
.\buildtools\sign_files.ps1 -Filters AWSXRayRecorder.*.dll -Recurse -Path .\sdk\src\Handlers\EntityFramework\bin\Release
.\buildtools\sign_files.ps1 -Filters AWSXRayRecorder.*.dll -Recurse -Path .\sdk\src\Handlers\SqlServer\bin\Release
.\buildtools\sign_files.ps1 -Filters AWSXRayRecorder.*.dll -Recurse -Path .\sdk\src\Handlers\System.Net\bin\Release
# - name: Pack nugets
# run: >
# dotnet pack
# .\sdk\AWSXRayRecorder.sln
# --no-build
# -c Release
# -o .\Deployment\nuget-packages
# nuget pack
# .\sdk\AWSXRayRecorder.nuspec
# -OutputDirectory .\Deployment\nuget-packages
# -Exclude **
# - name: Upload nugets to this GitHub Action run as an artifact
# uses: actions/upload-artifact@v2
# with:
# name: nuget-packages
# path: Deployment/nuget-packages/
# - name: Assume nuget role
# uses: aws-actions/configure-aws-credentials@v1
# with:
# role-to-assume: ${{ secrets.NUGET_ACCESS_ROLE_ARN }}
# aws-region: us-west-2
# - name: Push packages to Nuget.org
# run: >
# $nugetKey = aws secretsmanager get-secret-value
# --secret-id ${{ secrets.NUGET_SECRETS_ID }}
# --region us-west-2
# --output text
# --query SecretString | ConvertFrom-Json
# nuget push
# .\Deployment\nuget-packages\*.nupkg
# -Source https://api.nuget.org/v3/index.json
# -ApiKey $nugetKey.Key
# - name: Create draft release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: 'V${{ github.event.inputs.version }}'
# release_name: 'Release ${{ github.event.inputs.version }}'
# body: 'Please refer [change-log](https://github.com/aws/aws-xray-sdk-dotnet/blob/master/CHANGELOG.md) for more details'
# draft: true
# prerelease: false