File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Build
22
33on :
4+ workflow_dispatch :
45 push :
5- branches : [main]
66 tags : ['v*']
7- pull_request :
8- branches : [main]
9- workflow_dispatch :
107
118jobs :
129 build :
3431 - name : Publish (AOT)
3532 run : dotnet publish ClaudeUsageMonitor.csproj -c Release -r ${{ matrix.rid }} -o publish/${{ matrix.rid }}
3633
34+ - name : Package (Linux)
35+ if : runner.os == 'Linux'
36+ run : |
37+ cd publish/${{ matrix.rid }}
38+ tar -czf ../../${{ matrix.artifact }}.tar.gz .
39+
40+ - name : Package (Windows)
41+ if : runner.os == 'Windows'
42+ shell : pwsh
43+ run : Compress-Archive -Path publish/${{ matrix.rid }}/* -DestinationPath ${{ matrix.artifact }}.zip
44+
3745 - name : Upload artifact
3846 uses : actions/upload-artifact@v4
3947 with :
4048 name : ${{ matrix.artifact }}
41- path : publish/${{ matrix.rid }}
42- if-no-files-found : error
49+ path : |
50+ ${{ matrix.artifact }}.tar.gz
51+ ${{ matrix.artifact }}.zip
52+ if-no-files-found : ignore
53+
54+ release :
55+ needs : build
56+ if : startsWith(github.ref, 'refs/tags/v')
57+ runs-on : ubuntu-latest
58+ permissions :
59+ contents : write
60+
61+ steps :
62+ - name : Download artifacts
63+ uses : actions/download-artifact@v4
64+ with :
65+ path : artifacts
66+ merge-multiple : true
67+
68+ - name : Create release
69+ env :
70+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
71+ run : |
72+ gh release create "${GITHUB_REF_NAME}" \
73+ --repo "${GITHUB_REPOSITORY}" \
74+ --title "${GITHUB_REF_NAME}" \
75+ --generate-notes \
76+ artifacts/*
You can’t perform that action at this time.
0 commit comments