-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (48 loc) · 1.6 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
name: Build and release mysql.odbc package to Chocolatey
on:
pull_request:
branches:
- master
types:
- closed
workflow_dispatch:
jobs:
pack:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get branch name
id: branch-name
uses: tj-actions/[email protected]
- name: Choco pack
uses: crazy-max/ghaction-chocolatey@v2
with:
args: pack
- name: Save package file name as env var
run: |
chcp 65001 #set code page to utf-8
echo ("PACKAGE_NAME=" + $(Get-ChildItem *.nupkg -Name)) >> $env:GITHUB_ENV
- name: Choco set API key
uses: crazy-max/ghaction-chocolatey@v2
env:
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
with:
args: apikey --key "${{ env.CHOCOLATEY_API_KEY }}" --source https://push.chocolatey.org/
- name: Choco push package
uses: crazy-max/ghaction-chocolatey@v2
with:
args: push "${{ env.PACKAGE_NAME }}" --source https://push.chocolatey.org/
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.PAT }}
tag_prefix: ''
custom_tag: ${{ steps.branch-name.outputs.current_branch }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}