This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +65
-4
lines changed Expand file tree Collapse file tree 4 files changed +65
-4
lines changed Original file line number Diff line number Diff line change @@ -20,21 +20,21 @@ cp ../gon.json $tmpdir/gon.json
20
20
pushd " $tmpdir "
21
21
case " $GOOS " in
22
22
" windows" )
23
- artifact=" coder-cli-$GOOS -$GOARCH .zip"
23
+ artifact=" coder-cli-$GOOS -$GOARCH - $tag .zip"
24
24
mv coder coder.exe
25
25
zip " $artifact " coder.exe
26
26
;;
27
27
" linux" )
28
- artifact=" coder-cli-$GOOS -$GOARCH .tar.gz"
28
+ artifact=" coder-cli-$GOOS -$GOARCH - $tag .tar.gz"
29
29
tar -czf " $artifact " coder
30
30
;;
31
31
" darwin" )
32
32
if [[ ${CI-} ]]; then
33
- artifact=" coder-cli-$GOOS -$GOARCH .zip"
33
+ artifact=" coder-cli-$GOOS -$GOARCH - $tag .zip"
34
34
gon -log-level debug ./gon.json
35
35
mv coder.zip $artifact
36
36
else
37
- artifact=" coder-cli-$GOOS -$GOARCH .tar.gz"
37
+ artifact=" coder-cli-$GOOS -$GOARCH - $tag .tar.gz"
38
38
tar -czf " $artifact " coder
39
39
echo " --- warning: not in ci, skipping signed release of darwin"
40
40
fi
Original file line number Diff line number Diff line change
1
+ import { exec } from "https://cdn.depjs.com/exec/mod.ts"
2
+
3
+ export const root = async ( ) => Deno . chdir ( await exec ( "git rev-parse --show-toplevel" ) )
4
+ export const string = ( a : Uint8Array ) : string => new TextDecoder ( ) . decode ( a )
5
+ export const bytes = ( a : string ) : Uint8Array => new TextEncoder ( ) . encode ( a )
6
+ export const read = async ( path : string ) : Promise < string > =>
7
+ string ( await Deno . readFile ( path ) )
8
+ export const write = async ( path : string , data : string ) : Promise < void > =>
9
+ Deno . writeFile ( path , bytes ( data ) )
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env -S deno run --allow-all
2
+ import { root , write } from "./lib.ts"
3
+
4
+ await root ( )
5
+
6
+ interface Params {
7
+ sha : string
8
+ version : string
9
+ }
10
+
11
+ const template = ( { sha, version } : Params ) => `class Coder < Formula
12
+ desc "a command line tool for the Coder remote development platorm"
13
+ homepage "https://github.com/cdr/coder-cli"
14
+ url "https://github.com/cdr/coder-cli/releases/download/${ version } /coder-cli-darwin-amd64-${ version } .zip"
15
+ sha256 "${ sha } "
16
+
17
+ bottle :unneeded
18
+
19
+ def install
20
+ bin.install "coder"
21
+ end
22
+
23
+ test do
24
+ system "#{bin}/coder", "--version"
25
+ end
26
+ end
27
+ `
28
+
29
+ if ( Deno . args . length < 2 ) {
30
+ throw Error ( "2 args required" )
31
+ }
32
+
33
+ const version = Deno . args [ 0 ]
34
+ const sha = Deno . args [ 1 ]
35
+
36
+ await write ( "./coder.rb" , template ( { sha, version } ) )
Original file line number Diff line number Diff line change
1
+ class Coder < Formula
2
+ desc "a command line tool for the Coder remote development platorm"
3
+ homepage "https://github.com/cdr/coder-cli"
4
+ url "https://github.com/cdr/coder-cli/releases/download/v1.14.2/coder-cli-darwin-amd64-v1.14.2.zip"
5
+ sha256 "69b69497a75ce19851681974aa7561af7c7061357f8616e24446e58795bf6e1f"
6
+
7
+ bottle :unneeded
8
+
9
+ def install
10
+ bin . install "coder"
11
+ end
12
+
13
+ test do
14
+ system "#{ bin } /coder" , "--version"
15
+ end
16
+ end
You can’t perform that action at this time.
0 commit comments