-
Notifications
You must be signed in to change notification settings - Fork 165
executable file
·122 lines (117 loc) · 5.22 KB
/
publish-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
# Do not modify!
# This file was generated from a template using https://github.com/apple/pkl
name: Publish Release
'on':
workflow_dispatch: {}
env:
REALM_DISABLE_ANALYTICS: true
DOTNET_NOLOGO: true
jobs:
main:
name: Publish Release
environment: Production
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Download all artifacts
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: pr.yml
commit: ${{ github.sha }}
path: Realm/packages/
workflow_conclusion: completed
- name: Read version
id: get-version
run: |-
cd Realm/packages
pkgVersion=$(find . -type f -regex ".*Realm.[1-9].*.nupkg" -exec basename {} \; | sed -n 's/Realm\.\(.*\)\.nupkg$/\1/p')
echo "package_version=$pkgVersion" >> $GITHUB_OUTPUT
shell: bash
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-access-key-id: ${{ secrets.DOCS_S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.DOCS_S3_SECRET_KEY }}
aws-region: us-east-2
- name: Upload docs
run: |-
Expand-Archive -Path Realm/packages/Docs.zip/Docs.zip -DestinationPath Realm/packages
$versions = "${{ steps.get-version.outputs.package_version }}", "latest"
Foreach ($ver in $versions)
{
aws s3 sync --acl public-read "${{ github.workspace }}\Realm\packages\_site" s3://realm-sdks/docs/realm-sdks/dotnet/$ver/
}
- name: NuGet Publish Realm.${{ steps.get-version.outputs.package_version }}
run: dotnet nuget push ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.package_version }}/Realm.${{ steps.get-version.outputs.package_version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- name: NuGet Publish Realm.PlatformHelpers.${{ steps.get-version.outputs.package_version }}
run: dotnet nuget push ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ steps.get-version.outputs.package_version }}/Realm.PlatformHelpers.${{ steps.get-version.outputs.package_version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 16.x
registry-url: https://registry.npmjs.org
- name: NPM publish io.realm.unity-${{ steps.get-version.outputs.package_version }}.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish ${{ github.workspace }}/Realm/packages/io.realm.unity-${{ steps.get-version.outputs.package_version }}.tgz/io.realm.unity-${{ steps.get-version.outputs.package_version }}.tgz --tag latest
- name: Find Release PR
id: find-pull-request
uses: juliangruber/find-pull-request-action@48b6133aa6c826f267ebd33aa2d29470f9d9e7d0
with:
branch: ${{ github.ref }}
- name: Merge Pull Request
uses: juliangruber/merge-pull-request-action@9234b8714dda9a08f3d1df5b2a6a3abd7b695353
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.find-pull-request.outputs.number }}
method: squash
- name: Publish Github Release
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5
with:
artifacts: Realm/packages/io.realm.unity-${{ steps.get-version.outputs.package_version }}.tgz/io.realm.unity-${{ steps.get-version.outputs.package_version }}.tgz
bodyFile: Realm/packages/ExtractedChangelog/ExtractedChangelog.md
name: ${{ steps.get-version.outputs.package_version }}
commit: main
tag: ${{ steps.get-version.outputs.package_version }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
- name: Update Changelog
run: |-
echo "## vNext (TBD)
### Enhancements
* None
### Fixed
* None
### Compatibility
* Realm Studio: 15.0.0 or later.
### Internal
* Using Core x.y.z.
" | cat - CHANGELOG.md >> temp
mv temp CHANGELOG.md
shell: bash
- name: Create vNext PR
id: vnext-pr
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e
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@9234b8714dda9a08f3d1df5b2a6a3abd7b695353
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.vnext-pr.outputs.pull-request-number }}
method: squash
- name: 'Post to #realm-releases'
uses: realm/ci-actions/release-to-slack@6418e15ed9bbdb19b7d456a347e5623779f95cdf
with:
changelog: Realm/packages/ExtractedChangelog/ExtractedChangelog.md
sdk: .NET
webhook-url: ${{ secrets.SLACK_RELEASE_WEBHOOK }}
version: ${{ steps.get-version.outputs.package_version }}