File tree 5 files changed +66
-28
lines changed
.github/actions/nix-devshell
5 files changed +66
-28
lines changed Original file line number Diff line number Diff line change 4
4
using : " composite"
5
5
steps :
6
6
- name : Setup Nix
7
- uses : DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # v16
7
+ uses : nixbuild/nix-quick-install-action@5bb6a3b3abe66fd09bbf250dce8ada94f856a703 # v30
8
+
9
+ - uses : nix-community/cache-nix-action@92aaf15ec4f2857ffed00023aecb6504bb4a5d3d # v6
10
+ with :
11
+ # restore and save a cache using this key
12
+ primary-key : nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
13
+ # if there's no cache hit, restore a cache by this prefix
14
+ restore-prefixes-first-match : nix-${{ runner.os }}-
15
+ # collect garbage until Nix store size (in bytes) is at most this number
16
+ # before trying to save a new cache
17
+ # 1 GB = 1073741824 B
18
+ gc-max-store-size-linux : 1073741824
19
+ # do purge caches
20
+ purge : true
21
+ # purge all versions of the cache
22
+ purge-prefixes : nix-${{ runner.os }}-
23
+ # created more than this number of seconds ago relative to the start of the `Post Restore` phase
24
+ purge-created : 0
25
+ # except the version with the `primary-key`, if it exists
26
+ purge-primary-key : never
8
27
9
28
- name : Enter devshell
10
29
uses : nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1
30
+ with :
31
+ arguments : " .#ci"
Original file line number Diff line number Diff line change
1
+ ! .github
Original file line number Diff line number Diff line change @@ -11,14 +11,18 @@ XCPROJECT := Coder\ Desktop/Coder\ Desktop.xcodeproj
11
11
SCHEME := Coder\ Desktop
12
12
SWIFT_VERSION := 6.0
13
13
14
- CURRENT_PROJECT_VERSION: =$(shell git describe --match 'v[0-9]* ' --dirty='.devel' --always --tags)
14
+ ifndef CURRENT_PROJECT_VERSION
15
+ CURRENT_PROJECT_VERSION:=$(shell git describe --match 'v[0-9]*' --dirty='.devel' --always --tags)
16
+ endif
15
17
ifeq ($(strip $(CURRENT_PROJECT_VERSION ) ) ,)
16
- $(error CURRENT_PROJECT_VERSION cannot be empty)
18
+ $(error CURRENT_PROJECT_VERSION cannot be empty)
17
19
endif
18
20
19
- MARKETING_VERSION: =$(shell git describe --match 'v[0-9]* ' --tags --abbrev=0 | sed 's/^v//' | sed 's/-.* $$//')
21
+ ifndef MARKETING_VERSION
22
+ MARKETING_VERSION:=$(shell git describe --match 'v[0-9]*' --tags --abbrev=0 | sed 's/^v//' | sed 's/-.*$$//')
23
+ endif
20
24
ifeq ($(strip $(MARKETING_VERSION ) ) ,)
21
- $(error MARKETING_VERSION cannot be empty)
25
+ $(error MARKETING_VERSION cannot be empty)
22
26
endif
23
27
24
28
# Define the keychain file name first
Original file line number Diff line number Diff line change 53
53
{
54
54
inherit formatter ;
55
55
56
- devShells . default = pkgs . mkShellNoCC {
57
- buildInputs = with pkgs ; [
58
- actionlint
59
- apple-sdk_15
60
- clang
61
- coreutils
62
- create-dmg
63
- formatter
64
- gh
65
- gnumake
66
- protobuf_28
67
- protoc-gen-swift
68
- swiftformat
69
- swiftlint
70
- watchexec
71
- xcbeautify
72
- xcodegen
73
- xcpretty
74
- zizmor
75
- ] ;
56
+ devShells = rec {
57
+ # Need to use a devshell for CI, as we want to reuse the already existing Xcode on the runner
58
+ ci = pkgs . mkShellNoCC {
59
+ buildInputs = with pkgs ; [
60
+ actionlint
61
+ clang
62
+ coreutils
63
+ create-dmg
64
+ gh
65
+ git
66
+ gnumake
67
+ protobuf_28
68
+ protoc-gen-swift
69
+ swiftformat
70
+ swiftlint
71
+ xcbeautify
72
+ xcodegen
73
+ xcpretty
74
+ zizmor
75
+ ] ;
76
+ } ;
77
+
78
+ default = pkgs . mkShellNoCC {
79
+ buildInputs =
80
+ with pkgs ;
81
+ [
82
+ apple-sdk_15
83
+ formatter
84
+ watchexec
85
+ ]
86
+ ++ ci . buildInputs ;
87
+ } ;
76
88
} ;
77
89
}
78
90
) ;
You can’t perform that action at this time.
0 commit comments