-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.67 KB
/
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
name: Build and package for release
on:
release:
types: [published]
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
env:
PRODUCT_NAME: CanIUse
PROJECT_PATH: src/CanIUse/Community.PowerToys.Run.Plugin.CanIUse
SLN_PATH: src/CanIUse/CanIUse.sln
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from release tag
id: extract_version
run: |
$version = '${{ github.event.release.tag_name }}'
echo "VERSION=$version" >> $env:GITHUB_ENV
shell: powershell
- name: Replace version token in plugin.json
run: |
(Get-Content '${{ env.PROJECT_PATH }}/plugin.json') -replace '\$\(Version\)', '${{ env.VERSION }}' | Set-Content '${{ env.PROJECT_PATH }}/plugin.json'
shell: powershell
- name: Package
run: |
dotnet pack ${{ env.SLN_PATH }} -p:Platform=x64 -p:Version=${{ env.VERSION }}
dotnet pack ${{ env.SLN_PATH }} -p:Platform=ARM64 -p:Version=${{ env.VERSION }}
- name: Upload x64 To Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
file: ${{ env.PROJECT_PATH }}/${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-x64.zip
asset_name: ${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-x64.zip
- name: Upload ARM64 To Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
file: ${{ env.PROJECT_PATH }}/${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-ARM64.zip
asset_name: ${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-ARM64.zip