Merge origin/main into naming, resolve conflicts with module rename · Entire
Merge origin/main into naming, resolve conflicts with module rename
0327e2f→main·
copilot·2mo ago·5 files·+186 added/-0 removed
Co-authored-by: pjbgf 5452977+pjbgf@users.noreply.github.com
Changes
5
.github/workflows
Arelease.yml+102
M.gitignore+3
A.goreleaser.yaml+68
cmd/git-sync
internal/versioninfo
Aversioninfo.go+7
Mmain.go+6
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release tag (semver with v prefix, e.g. v1.2.3)"
required: true
type: string
push:
tags:
- "v*"
permissions:
contents: write
env:
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || github.ref_name }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: ${{ env.RELEASE_TAG }}
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4
- name: Setup Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
cache: false
go-version-file: go.mod
- name: Generate Homebrew Tap token
id: app-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
app-id: ${{ secrets.HOMEBREW_TAP_APP_ID }}
private-key: ${{ secrets.HOMEBREW_TAP_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
homebrew-tap
- name: Extract release notes from CHANGELOG.md
run: |
VERSION="${RELEASE_TAG#v}"
awk -v ver="${VERSION}" 'BEGIN{header="^## \[" ver "\]"} $0 ~ header{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md > "$RUNNER_TEMP/release_notes.md"\
if [ ! -s "$RUNNER_TEMP/release_notes.md" ]; then\
echo "::error::No changelog entry found for version ${VERSION} in CHANGELOG.md"\
exit 1\
fi\
- name: Run GoReleaser\
uses: goreleaser/goreleaser-action@1a80836c5c9d9e5755a25cb59ec6f45a3b5f41a8 # v7\
with:\
distribution: goreleaser-pro\
version: latest\
args: release --clean --release-notes=${{ runner.temp }}/release_notes.md\
env:\
GORELEASER_CURRENT_TAG: ${{ env.RELEASE_TAG }}\
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\
TAP_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}\
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}\
MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}\
MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }}\
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}\
MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}\
MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }}\
notify-slack:\
runs-on: ubuntu-latest\
needs: [release]\
if: ${{ always() && needs.release.result == 'failure' }}\
steps:\
- name: Notify Slack of release failure\
uses: slackapi/slack-github-action@03ea5433c137af7c0495bc0cad1af10403fc800c # v3.0.2\
with:\
webhook: ${{ secrets.E2E_SLACK_WEBHOOK_URL }}\
webhook-type: incoming-webhook\
payload: |\
{\
"blocks": [\
{\
"type": "section",\
"text": {\
"type": "mrkdwn",\
"text": ":red_circle: *Release Failed* for `${{ env.RELEASE_TAG }}`\n\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View run details>"\
}\
},\
{\
"type": "context",\
"elements": [\
{\
"type": "mrkdwn",\
"text": "Tag: `${{ env.RELEASE_TAG }}` by ${{ github.actor }}"\
}\
]\
}\
]\
}\
```\
A.github/workflows/release.yml+102
```\
44 unmodified lines\
45\
46\
47\
48\
49\
50\
\
# Build output directory\
/dist/\
M.gitignore+3
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\
A.goreleaser.yaml+68
1\
2\
3\
4\
5\
6\
7\
\
package versioninfo\
\
var (\
\tVersion = "dev"\
\tCommit = "none"\
\tDate = "unknown"\
)\
Acmd/git-sync/internal/versioninfo/versioninfo.go+7
9 unmodified lines\
\
10\
11\
12\
13\
14\
15\
16\
24 unmodified lines\
\
41\
42\
43\
44\
45\
46\
47\
48\
49\
50\
385 unmodified lines\
\
436\
437\
438\
439\
440\
441\
442\
\
9 unmodified lines\
\
\t\"strings\"\
\n\t\"entire.io/entire/git-sync\"\
\t\"entire.io/entire/git-sync/cmd/git-sync/internal/versioninfo\"\
\t\"entire.io/entire/git-sync/internal/validation\"\
\t\"entire.io/entire/git-sync/unstable\"\
\t\"github.com/go-git/go-git/v6/plumbing\"\
24 unmodified lines\
\n\t\treturn runProbe(ctx, args[1:])\
\t\tcase \"fetch\":\
\t\t\treturn runFetch(ctx, args[1:])\
\t\tcase \"version\", \"--version\":\
\t\t\tfmt.Printf(\"git-sync %s (commit %s, built %s)\",\
\t\t\t\tversioninfo.Version, versioninfo.Commit, versioninfo.Date)\
\t\t\treturn nil\
\t\tcase \"help\", \"-h\", \"--help\":\
\t\t\treturn usageError(\"\")\
\t\tdefault:\
385 unmodified lines\
\n\t{\
\t\t\t%[1]s bootstrap [flags] <source-url> <target-url>\
\t\t\t%[1]s probe [flags] <source-url> [target-url]\
\t\t\t%[1]s fetch [flags] <source-url>\
\t\t\t%[1]s version\
\n\tsync flags:\
\t\t--branch main,dev\
```\
Mcmd/git-sync/main.go+6