-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (182 loc) · 5.75 KB
/
build.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Cross Build and Release
on:
workflow_dispatch:
push:
tags:
- "v[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}"
permissions:
contents: write
jobs:
# build-windows:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
#
# - name: Install Rust
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# override: true
# toolchain: stable
# target: x86_64-pc-windows-gnu
#
# - name: Install cross
# run: cargo install cross --git https://github.com/cross-rs/cross
#
# - name: Build for Windows
# run: cross build --release --target x86_64-pc-windows-gnu
#
# - name: Create artifacts directory
# run: mkdir artifacts
#
# - name: Copy binary to artifacts
# run: cp target/x86_64-pc-windows-gnu/release/jobshell.exe artifacts/
#
# - name: Upload Windows binary
# uses: actions/upload-artifact@v3
# with:
# name: windows-artifacts
# path: artifacts/
#
# build-macos:
# runs-on: macos-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
#
# - name: Install Rust
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# override: true
# toolchain: stable
#
# - name: Add macOS targets
# run: |
# rustup target add x86_64-apple-darwin
# rustup target add aarch64-apple-darwin
#
# - name: Create artifacts directory
# run: mkdir artifacts
#
# - name: Build for macOS (x86_64)
# run: cargo build --release --target x86_64-apple-darwin
#
# - name: Copy x86_64 binary
# run: cp target/x86_64-apple-darwin/release/jobshell artifacts/jobshell-x86_64
#
# - name: Build for macOS (aarch64)
# run: cargo build --release --target aarch64-apple-darwin
#
# - name: Copy aarch64 binary
# run: cp target/aarch64-apple-darwin/release/jobshell artifacts/jobshell-aarch64
#
# - name: Upload macOS binaries
# uses: actions/upload-artifact@v3
# with:
# name: macos-artifacts
# path: artifacts/
#
# release:
# needs: [build-windows, build-macos]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
#
# - name: Create release directory
# run: mkdir release-binaries
#
# - name: Download all artifacts
# uses: actions/download-artifact@v3
# with:
# path: release-binaries
#
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref_name }}
# release_name: Release ${{ github.ref_name }}
# draft: false
# prerelease: false
#
# - name: Upload Windows Binary
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: release-binaries/windows-artifacts/jobshell.exe
# asset_name: jobshell-windows-x86_64.exe
# asset_content_type: application/octet-stream
#
# - name: Upload macOS x86_64 Binary
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: release-binaries/macos-artifacts/jobshell-x86_64
# asset_name: jobshell-macos-x86_64
# asset_content_type: application/octet-stream
#
# - name: Upload macOS aarch64 Binary
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: release-binaries/macos-artifacts/jobshell-aarch64
# asset_name: jobshell-macos-aarch64
# asset_content_type: application/octet-stream
#
# publish-to-cargo:
# # needs: [release]
# runs-on: macos-latest
# steps:
# # Step 1: Checkout the repository
# - name: Checkout code
# uses: actions/checkout@v3
#
# # Step 2: Install Rust
# - name: Set up Rust
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
#
# # Step 3: Validate the package
# - name: Validate Cargo Package
# run: cargo package --allow-dirty
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
#
# # Step 4: Publish to Crates.io
# - name: Publish to crates.io
# run: cargo publish --allow-dirty
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
update-homebrew-tap:
# needs: [release]
runs-on: macos-latest
steps:
# Step 1: Parse the version from the tag
- name: Extract version
id: extract_version
run: |
TAG_NAME=${GITHUB_REF##*/}
VERSION=${TAG_NAME#v}
echo "Extracted version: $VERSION"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
# Step 2: Clone the homebrew-jobshell repository
- name: Clone homebrew-jobshell repository
run: |
git clone https://${{ secrets.GITHUB_TOKEN }}@github.com/angelplusultra/homebrew-jobshell.git
cd homebrew-jobshell
# Step 3: Run the update script in the cloned repository
# - name: Run Homebrew update script
# working-directory: homebrew-jobshell
# run: ./script.sh $VERSION