-
-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (74 loc) · 2.47 KB
/
Copy path_release.yml
File metadata and controls
85 lines (74 loc) · 2.47 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
name: _release
on:
workflow_call:
inputs:
release_tag:
description: 'The release tag (e.g. v1.0.0)'
required: true
type: string
secrets:
CARGO_REGISTRY_TOKEN:
description: 'Token for publishing to crates.io'
required: true
env:
CARGO_TERM_COLOR: always
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Generate Release Notes
id: changelog
uses: orhun/git-cliff-action@v4
with:
config: .github/cliff.toml
args: --latest --strip header
- name: Update Version for crates.io
run: |
VERSION="${{ inputs.release_tag }}"
# Strip the 'v' prefix if present
VERSION="${VERSION#v}"
sed -i "s/0\\.0\\.0-git/$VERSION/" Cargo.toml
sed -i "s/0\\.0\\.0-git/$VERSION/" Cargo.lock
- name: Publish to crates.io
# --no-verify skips the verification build since CI already built and tested
# --allow-dirty allows publishing with modified Cargo.toml/Cargo.lock (version update)
run: cargo publish --no-verify --allow-dirty --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Download Linux Build
uses: actions/download-artifact@v8
with:
name: gitopolis-linux-x86_64
path: artifacts
- name: Download Windows Build
uses: actions/download-artifact@v8
with:
name: gitopolis-windows-x86_64
path: artifacts
- name: Download macOS x86_64 Build
uses: actions/download-artifact@v8
with:
name: gitopolis-macos-x86_64
path: artifacts
- name: Download macOS aarch64 Build
uses: actions/download-artifact@v8
with:
name: gitopolis-macos-aarch64
path: artifacts
- name: Generate SHA256 Checksums
working-directory: artifacts
run: |
sha256sum gitopolis-linux-x86_64.tar.gz gitopolis-windows-x86_64.zip gitopolis-macos-x86_64.tar.gz gitopolis-macos-aarch64.tar.gz > SHA256SUMS.txt
- name: Create Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ inputs.release_tag }}
name: ${{ inputs.release_tag }}
body: ${{ steps.changelog.outputs.content }}
files: |
artifacts/gitopolis-linux-x86_64.tar.gz
artifacts/gitopolis-windows-x86_64.zip
artifacts/gitopolis-macos-x86_64.tar.gz
artifacts/gitopolis-macos-aarch64.tar.gz
artifacts/SHA256SUMS.txt