-
-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (106 loc) · 4.05 KB
/
release.yml
File metadata and controls
131 lines (106 loc) · 4.05 KB
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
124
125
126
127
128
129
130
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
actions: read
env:
PROJECT_PATH: src/CodingWithCalvin.VSToolbox/CodingWithCalvin.VSToolbox.csproj
APP_NAME: VSToolbox
jobs:
changelog:
name: Generate Changelog
uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main
secrets: inherit
build:
runs-on: windows-latest
strategy:
matrix:
platform: [x64, arm64]
outputs:
version: ${{ steps.version.outputs.VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Get version from tag
id: version
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$version = $tag -replace '^v', ''
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
echo "Version: $version"
- name: Restore dependencies
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: Build portable
run: |
dotnet publish ${{ env.PROJECT_PATH }} `
--configuration Release `
--runtime win-${{ matrix.platform }} `
--self-contained true `
-p:PublishSingleFile=false `
-p:PublishReadyToRun=true `
-p:Platform=${{ matrix.platform }} `
--output ./artifacts/portable/${{ matrix.platform }}
- name: Zip portable build
shell: pwsh
run: |
Compress-Archive -Path ./artifacts/portable/${{ matrix.platform }}/* -DestinationPath ./artifacts/${{ env.APP_NAME }}-${{ steps.version.outputs.VERSION }}-${{ matrix.platform }}-portable.zip
- name: Upload portable artifact
uses: actions/upload-artifact@v4
with:
name: portable-${{ matrix.platform }}
path: ./artifacts/${{ env.APP_NAME }}-${{ steps.version.outputs.VERSION }}-${{ matrix.platform }}-portable.zip
release:
needs: [changelog, build]
runs-on: ubuntu-latest
outputs:
version: ${{ needs.build.outputs.version }}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List artifacts
run: ls -la artifacts/
- name: Create GitHub Release
uses: ncipollo/release-action@v1.14.0
with:
artifacts: artifacts/*
body: ${{ needs.changelog.outputs.changelog }}
makeLatest: true
tag: ${{ github.ref_name }}
prerelease: ${{ contains(github.ref_name, '-') }}
notify-bluesky:
needs: [release]
if: ${{ !contains(github.ref_name, '-') }}
uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main
with:
post_text: |
🚀 Visual Studio Toolbox v${{ needs.release.outputs.version }} released!
Visual Studio Toolbox is a sleek system tray application for Windows that helps you manage all your Visual Studio installations in one place.
[Check out the release notes here!](https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }})
secrets:
BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }}
BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }}
notify-x:
needs: [release]
if: ${{ !contains(github.ref_name, '-') }}
uses: CodingWithCalvin/.github/.github/workflows/x-post.yml@main
with:
post_text: |
🚀 Visual Studio Toolbox v${{ needs.release.outputs.version }} released!
Visual Studio Toolbox is a sleek system tray application for Windows that helps you manage all your Visual Studio installations in one place.
Check out the release notes here: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}
secrets:
X_CONSUMER_KEY: ${{ secrets.X_CONSUMER_KEY }}
X_CONSUMER_KEY_SECRET: ${{ secrets.X_CONSUMER_KEY_SECRET }}
X_ACCESS_TOKEN: ${{ secrets.X_ACCESS_TOKEN }}
X_ACCESS_TOKEN_SECRET: ${{ secrets.X_ACCESS_TOKEN_SECRET }}