generated from credfeto/cs-template
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (82 loc) · 3.49 KB
/
build-and-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
name: "Build: Release"
on:
push:
branches:
- 'release/*'
- 'hotfix/*'
# Don't cancel anything in progress
concurrency:
group: ${{github.workflow}}-${{github.ref}}-release
cancel-in-progress: false
permissions:
contents: write
security-events: write
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- name: "Initialise Workspace"
shell: bash
run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE"
- name: "Checkout Source"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Check Repo Visibility"
uses: credfeto/[email protected]
id: visibility
with:
repository: ${{github.repository}}
token: ${{secrets.GITHUB_TOKEN}}
- name: "Check Runner details"
shell: bash
run: |
echo "Name: ${{runner.name}}"
echo "OS: ${{runner.os}}"
- name: "Enable Local nuget feeds if caching"
if: startsWith(runner.name, 'buildagent-')
id: nuget-local-cache
shell: bash
run: |
{
echo "NUGET_BAGET_CACHE=${{vars.NUGET_BAGET_CACHE}}"
echo "PRERELEASE_BAGET_CACHE=${{vars.PRERELEASE_BAGET_CACHE}}"
echo "RELEASE_BAGET_CACHE=${{vars.RELEASE_BAGET_CACHE}}"
}>> "$GITHUB_OUTPUT"
- name: "Build and deploy"
uses: ./.github/actions/build
with:
PRODUCTION_BUILD: True
NPM_PRODUCTION_PACKAGER_VERSION: ${{vars.PRODUCTION_PACKAGER_VERSION}}
NPM_CONTENT_PACKAGE_WALLET_PASSWORD: ${{secrets.CONTENT_PACKAGE_WALLET_PASSWORD}}
NPM_PACKAGE_STORE_SIGNING_WALLET: ${{secrets.PACKAGE_STORE_SIGNING_WALLET}}
NPM_PACKAGE_STORE_SIGNING_WALLET_PASSWORD: ${{secrets.PACKAGE_STORE_SIGNING_WALLET_PASSWORD}}
NUGET_PUBLIC_RESTORE_FEED_CACHE: ${{steps.nuget-local-cache.outputs.NUGET_BAGET_CACHE}}
NUGET_PUBLIC_RESTORE_FEED: ${{vars.NUGET_PUBLIC_RESTORE_FEED}}
NUGET_ADDITIONAL_RESTORE_FEED_RELEASE_CACHE: ${{steps.nuget-local-cache.outputs.RELEASE_BAGET_CACHE}}
#NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE_CACHE: ${{vars.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE_CACHE}}
NUGET_ADDITIONAL_RESTORE_FEED_RELEASE: ${{vars.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE}}
#NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE: ${{vars.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE}}
NUGET_PACK: ${{vars.NUGET_PACK}}
NUGET_FEED: ${{secrets.NUGET_FEED}}
NUGET_SYMBOL_FEED: ${{secrets.NUGET_SYMBOL_FEED}}
NUGET_API_KEY: ${{secrets.NUGET_API_KEY}}
SLEET_CONFIG: ${{secrets.SLEET_CONFIG}}
SLEET_FEED: "dotnet-release"
OCTOPUS_SERVER: ${{vars.OCTOPUS_SERVER}}
OCTOPUS_SPACE_NAME: ${{vars.OCTOPUS_SPACE}}
OCTOPUS_PROJECT: ${{vars.OCTOPUS_PROJECT}}
OCTOPUS_CHANNEL: ${{vars.OCTOPUS_RELEASE_CHANNEL}}
OCTOPUS_DEPLOY_TO: ${{vars.OCTOPUS_DEPLOYTO_RELEASE}}
OCTOPUS_API_KEY: ${{secrets.OCTOPUS_API_KEY}}
OCTOPUS_DEPLOY_PACKAGE: ${{vars.OCTOPUS_DEPLOY_PACKAGE}}
OCTOPUS_DEPLOY_PACKAGE_ZIP: ${{vars.OCTOPUS_DEPLOY_PACKAGE_ZIP}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
REPO_VISIBILITY: ${{env.REPO_STATUS}}
CREATE_RELEASE: true
- name: "Build Version"
uses: actions/[email protected]
with:
script: |
core.info('Version: \u001b[38;5;6m${{env.BUILD_VERSION}}');
core.notice('Version: ${{env.BUILD_VERSION}}');