Skip to content

Commit 494bcd1

Browse files
committed
release: use the nix flake to pin versions
1 parent 708febe commit 494bcd1

File tree

5 files changed

+121
-18
lines changed

5 files changed

+121
-18
lines changed

.envrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
strict_env
2+
3+
has nix && use flake
4+
dotenv_if_exists .env # You can create a .env file with your env vars for this project. You can also use .secrets if you are using act. See the line below.
5+
dotenv_if_exists .secrets # Used by [act](https://nektosact.com/) to load secrets into the pipelines
6+
7+
env_vars_required SYSDIG_SECURE_ENDPOINT SYSDIG_SECURE_TOKEN

.github/workflows/release.yaml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,9 @@ jobs:
1414
uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
17-
- name: Set git identity
18-
run: |-
19-
git config user.name "github-actions"
20-
git config user.email "github-actions@github.com"
21-
- name: Check whether it's the latest commit
22-
run: if [[ $(git ls-remote origin -h ${{ github.ref }} | cut -f1) != ${{ github.sha }} ]]; then exit 1; fi
23-
- name: Setup Node
24-
uses: actions/setup-node@v4.0.2
25-
env:
26-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
27-
with:
28-
node-version: 20
29-
registry-url: https://registry.npmjs.org
30-
- name: Install build dependencies
31-
run: npm install -g yarn
17+
- uses: DeterminateSystems/nix-installer-action@main
18+
- uses: DeterminateSystems/magic-nix-cache-action@main
19+
- uses: DeterminateSystems/flake-checker-action@main
3220
- name: Install dependencies
3321
run: |
3422
yarn global add @backstage/cli
@@ -38,8 +26,6 @@ jobs:
3826
run: |
3927
yarn tsc --jsx react-jsx
4028
yarn build
41-
- name: Push new changelog to git
42-
run: git push --follow-tags
4329
- name: Release to GitHub releases
4430
run: errout=$(mktemp); gh release create $(cat package.json | jq -r .version) -R $GITHUB_REPOSITORY -t $(cat package.json | jq -r .version) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi
4531
env:

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,7 @@ dist
131131
yarn.lock
132132

133133
# tsc
134-
dist-types/
134+
dist-types/
135+
136+
.direnv
137+
.secrets

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
};
6+
7+
outputs =
8+
{
9+
self,
10+
nixpkgs,
11+
flake-utils,
12+
}:
13+
let
14+
overlays.default = final: prev: { };
15+
flake = flake-utils.lib.eachDefaultSystem (
16+
system:
17+
let
18+
pkgs = import nixpkgs {
19+
inherit system;
20+
config.allowUnfree = true;
21+
overlays = [ self.overlays.default ];
22+
};
23+
in
24+
{
25+
devShells.default =
26+
with pkgs;
27+
mkShell {
28+
packages =
29+
[
30+
nodejs
31+
typescript
32+
yarn-berry
33+
(python3.withPackages (p: with p; [ gyp ]))
34+
]
35+
++ (with nodePackages; [
36+
typescript-language-server
37+
node-gyp
38+
]);
39+
};
40+
41+
formatter = pkgs.nixfmt-rfc-style;
42+
}
43+
);
44+
in
45+
flake // { inherit overlays; };
46+
}

0 commit comments

Comments
 (0)