Skip to content

Commit 4b9612a

Browse files
committed
workflow...
1 parent 4ce6570 commit 4b9612a

1 file changed

Lines changed: 30 additions & 29 deletions

File tree

.github/workflows/release.yml

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags:
66
- 'v*'
77

8+
permissions:
9+
contents: write
10+
811
jobs:
912
build:
1013
runs-on: macos-latest
@@ -16,43 +19,41 @@ jobs:
1619
with:
1720
go-version: '>=1.19.0'
1821

19-
- name: Install Xcode Command Line Tools
20-
run: |
21-
if ! xcode-select -p &> /dev/null; then
22-
xcode-select --install
23-
fi
24-
2522
- name: Install pandoc
2623
run: brew install pandoc
2724

28-
- name: Build
25+
- name: Build Intel
2926
run: |
3027
export CGO_ENABLED=1
31-
go build -v -o md2cb
28+
GOOS=darwin GOARCH=amd64 go build -o md2cb-darwin-amd64
29+
30+
- name: Build Apple Silicon
31+
run: |
32+
export CGO_ENABLED=1
33+
GOOS=darwin GOARCH=arm64 go build -o md2cb-darwin-arm64
34+
35+
- name: Create Universal Binary
36+
run: |
37+
lipo -create -output md2cb-darwin-universal \
38+
md2cb-darwin-amd64 \
39+
md2cb-darwin-arm64
3240
33-
- name: Create Release
34-
id: create_release
35-
uses: actions/create-release@v1
41+
- name: Release
3642
env:
3743
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
with:
39-
tag_name: ${{ github.ref }}
40-
release_name: Release ${{ github.ref }}
41-
draft: false
42-
prerelease: false
43-
body: |
44-
macOS binary for md2cb
44+
run: |
45+
gh release create ${{ github.ref_name }} \
46+
--title "Release ${{ github.ref_name }}" \
47+
--notes "macOS binaries for md2cb
4548
4649
Requirements:
4750
- macOS
48-
- pandoc (`brew install pandoc`)
49-
50-
- name: Upload Release Asset
51-
uses: actions/upload-release-asset@v1
52-
env:
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
with:
55-
upload_url: ${{ steps.create_release.outputs.upload_url }}
56-
asset_path: ./md2cb
57-
asset_name: md2cb-macos
58-
asset_content_type: application/octet-stream
51+
- pandoc (\`brew install pandoc\`)
52+
53+
Available versions:
54+
- Universal Binary (works on both Intel and Apple Silicon)
55+
- Intel Mac (x86_64) specific binary
56+
- Apple Silicon (ARM64) specific binary" \
57+
md2cb-darwin-universal#"md2cb-darwin-universal" \
58+
md2cb-darwin-amd64#"md2cb-darwin-amd64" \
59+
md2cb-darwin-arm64#"md2cb-darwin-arm64"

0 commit comments

Comments
 (0)