-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (84 loc) · 2.81 KB
/
release.yml
File metadata and controls
102 lines (84 loc) · 2.81 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
name: Release plugin
on:
workflow_dispatch:
inputs:
rel_version:
description: 'Release version (examples: 1.9.0-rc.1, 1.9.1)'
required: true
type: string
env:
DOTNET_VERSION: '9.0.x'
ARTIFACT_DIR: ./release
PUBLISH_DIR: ${{ github.workspace }}/publish
DIST_DIR: ${{ github.workspace }}/dist
DOWNLOAD_DIR: ./downloaded-artifacts
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --configuration Release /p:Version='${{ inputs.rel_version }}' --no-restore
- name: Run tests
run: dotnet test --configuration Release /p:Version='${{ inputs.rel_version }}' --no-build
- name: Publish project
run: dotnet publish src/FlowSynx.Plugins.Base64.csproj -c Release -o "${{ env.PUBLISH_DIR }}"
- name: Package release artifacts
run: |
mkdir -p "${{ env.DIST_DIR }}"
cd "${{ env.PUBLISH_DIR }}"
7z a -tzip "${{ env.DIST_DIR }}/flowsynx.base64.${{ inputs.rel_version }}.zip" *
- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: uploaded-artifacts
path: ${{ env.DIST_DIR }}
release:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
name: uploaded-artifacts
path: ${{ env.DOWNLOAD_DIR }}
- name: Generate SHA256 checksums
run: |
cd "${{ env.DOWNLOAD_DIR }}"
for file in *; do sha256sum -b "$file" > "$file.sha256"; done
cd -
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: v${{ inputs.rel_version }}
name: Base64 Plugin v${{ inputs.rel_version }}
artifacts: "${{ env.DOWNLOAD_DIR }}/**/*.*"
body: |
This is the v${{ inputs.rel_version }} release of the Base64 plugin for FlowSynx System.
token: ${{ secrets.GH_TOKEN }}
create-branch:
runs-on: ubuntu-latest
needs: [build, release]
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create release branch
uses: peterjgrainger/action-create-branch@v2.2.0
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
branch: release-${{ inputs.rel_version }}
sha: ${{ github.sha }}