-
Notifications
You must be signed in to change notification settings - Fork 27
103 lines (89 loc) · 3.21 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
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
103
name: release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release-tag:
runs-on: ubuntu-latest
steps:
- name: Trigger tools repo tag workflow
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.TOOLS_DISPATCH_PAT }}
repository: obot-platform/tools
event-type: release
client-payload: '{"tag": "${{ github.ref_name }}"}'
- name: Trigger enterprise-tool repo tag workflow
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.ENTERPRISE_TOOLS_DISPATCH_PAT }}
repository: obot-platform/enterprise-tools
event-type: release
client-payload: '{"tag": "${{ github.ref_name }}"}'
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
winget-release:
needs: release-tag
if: "! contains(github.ref_name, '-rc')"
runs-on: windows-latest
steps:
- name: Install winget-create
run: |
Invoke-WebRequest -Uri 'https://aka.ms/wingetcreate/latest' -OutFile 'wingetcreate.exe'
- name: Create WinGet Package Update Pull Request
run: |
$url = "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/obot_${{ github.ref_name }}_windows_amd64.zip"
./wingetcreate.exe update --submit --token "${{ secrets.WINGET_GH_TOKEN }}" --urls $url --version "${{ github.ref_name }}" obot-platform.obot
chart-release:
needs: release-tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Package Helm chart
run: helm package chart --destination ./.packaged --version ${{ github.ref_name }} --app-version ${{ github.ref_name }}
- name: Checkout GitHub Pages Repository
uses: actions/checkout@v4
with:
repository: obot-platform/charts
token: ${{ secrets.CHARTS_REPO_TOKEN }}
path: gh-pages
- name: Run helm-docs
uses: losisin/helm-docs-github-action@v1
with:
chart-search-root: './chart'
output-file: '../gh-pages/README.md'
template-files: '../gh-pages/README.md.gotmpl'
- name: Update Helm Repo Index
run: |
cd gh-pages
mkdir -p charts
mv ../.packaged/* charts/
helm repo index . --url https://charts.obot.ai/ --merge index.yaml
- name: Commit and Push Changes
run: |
cd gh-pages
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add --all
git commit -m "Release new Helm chart version ${{ github.ref_name }}" || echo "No changes to commit"
git push