This repository was archived by the owner on Mar 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (48 loc) · 2 KB
/
build.yml
File metadata and controls
53 lines (48 loc) · 2 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
name: build
on: ['push', 'pull_request']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: storebot-${{ github.sha }}.zip
path: bin/Release/net6.0
- name: Get the version tag
id: get_tag
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Generate zip for release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: zip -j Storebot-${{ steps.get_tag.outputs.VERSION }}.zip ./bin/Release/net6.0/* ./README.md
- name: create release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_tag.outputs.VERSION }}
release_name: Release ${{ steps.get_tag.outputs.VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Storebot-${{ steps.get_tag.outputs.VERSION }}.zip
asset_name: Storebot-${{ steps.get_tag.outputs.VERSION }}.zip
asset_content_type: application/zip