-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (85 loc) · 2.75 KB
/
Copy pathrelease.yml
File metadata and controls
96 lines (85 loc) · 2.75 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to build (e.g., v1.0.0)'
required: true
type: string
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
env:
TAG: ${{ github.ref_name || inputs.tag }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.TAG }}
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
# Chocolatey and winget publishing live in chocolatey-publish.yml and
# winget-publish.yml respectively (workflow_dispatch only). Keeping them out
# of this workflow avoids gating the release on Microsoft-hosted services
# (wingetcreate's fork-sync, choco push) that fail intermittently and don't
# block the actual binary/Homebrew artifacts. Run them manually after a
# release: `gh workflow run chocolatey-publish.yml -f version=<X.Y.Z>` and
# `gh workflow run winget-publish.yml -f version=<X.Y.Z>`.
snap:
if: false # Temporarily disabled - waiting for personal-files interface approval
needs: goreleaser
runs-on: ubuntu-latest
env:
TAG: ${{ github.ref_name || inputs.tag }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.TAG }}
fetch-depth: 0
- name: Set snap version from tag
run: |
VERSION="${TAG#v}"
sed -i "s/^version: git$/version: '${VERSION}'/" snap/snapcraft.yaml
echo "Snap version: ${VERSION}"
grep '^version:' snap/snapcraft.yaml
- name: Build snap
uses: snapcore/action-build@v1
id: build
- name: Publish to Snapcraft Store
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: ${{ steps.build.outputs.snap }}
release: stable
linux-packages:
needs: goreleaser
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Trigger linux-packages repo update
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.LINUX_PACKAGES_DISPATCH_TOKEN }}
repository: open-cli-collective/linux-packages
event-type: package-release
client-payload: |-
{
"package": "google-readonly",
"version": "${{ github.ref_name }}",
"repo": "open-cli-collective/google-readonly"
}