Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.

Commit 0bd3440

Browse files
committed
fix(ci): fix compilation in docker image
- add semantic-release to publish Rust to crates.io
1 parent 6dbde94 commit 0bd3440

File tree

7 files changed

+69
-11
lines changed

7 files changed

+69
-11
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,25 @@ jobs:
197197
- name: Combine checksums
198198
run: cat dist/**/typescript-tools-*-SHASUMS256.txt | tee npm/SHASUMS256.txt
199199

200+
- name: Cache cargo
201+
uses: actions/cache@v3
202+
id: cache-cargo
203+
with:
204+
path: |
205+
~/.cargo/bin/
206+
~/.cargo/registry/index/
207+
~/.cargo/registry/cache/
208+
~/.cargo/git/db/
209+
target/
210+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
211+
212+
- name: Install semantic-release-rust
213+
uses: actions-rs/cargo@v1
214+
if: steps.cache-cargo.outputs.cache-hit != 'true'
215+
with:
216+
command: install
217+
args: semantic-release-rust --version 1.0.0-alpha.8
218+
200219
- name: Invoke semantic-release
201220
env:
202221
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/.direnv/
22
/.pre-commit-config.yaml
3-
/target
3+
/node_modules/
4+
/result
5+
/target/

.releaserc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959
}
6060
]
6161
}
62+
],
63+
[
64+
"@semantic-release/exec",
65+
{
66+
"verifyContitionsCmd": "semantic-release-rust verify-conditions",
67+
"prepareCmd": "semantic-release-rust prepare ${nextRelease.version}",
68+
"publishCmd": "semantic-release-rust publish"
69+
}
6270
]
6371
]
6472
}

Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@ from rust:1.65.0@sha256:b0f2a9e48df82f009fda8ae777119e7983104a1b4dc47026653b6cda
33
# create a dummy project
44
RUN apt-get update && \
55
apt-get install --yes musl-tools curl llvm clang && \
6-
rustup target add x86_64-unknown-linux-musl && \
7-
USER=root cargo new --bin rust-implementation
6+
rustup target add x86_64-unknown-linux-musl
87
WORKDIR /rust-implementation
98

109
# copy over manifests
1110
COPY ./Cargo.lock ./Cargo.lock
1211
COPY ./Cargo.toml ./Cargo.toml
1312

14-
# cache build dependencies
15-
RUN cargo build --release --target x86_64-unknown-linux-musl && \
16-
rm -r src/
17-
1813
# copy over project source
1914
COPY ./templates ./templates
2015
COPY ./src ./src

flake.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
# doCheck = true;
5252
buildInputs = with pkgs; [
5353
fenix-channel.rustc
54-
fenix-channel.clippy
55-
nodePackages.typescript
5654
];
5755

5856
nativeBuildInputs = with pkgs; [
@@ -122,8 +120,8 @@
122120
fenix-toolchain
123121
fenix.packages.${system}.rust-analyzer
124122

125-
# Nix
126123
pkgs.cargo-watch
124+
pkgs.nodejs
127125
pkgs.rnix-lsp
128126
];
129127

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"devDependencies": {
2323
"@codedependant/semantic-release-docker": "4.1.0",
24+
"@semantic-release/exec": "6.0.3",
2425
"@semantic-release/git": "10.0.1",
2526
"@semantic-release/github": "8.0.6",
2627
"@semantic-release/npm": "9.0.1",
@@ -31,4 +32,4 @@
3132
"bin/",
3233
"npm/"
3334
]
34-
}
35+
}

0 commit comments

Comments
 (0)