Skip to content

Commit

Permalink
Add gh action to vendor Cargo source
Browse files Browse the repository at this point in the history
  • Loading branch information
declantsien committed Apr 15, 2024
1 parent 03bd58e commit 0518391
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
17 changes: 12 additions & 5 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
watch_file nix/* flake.nix
{
mkdir -p "$(direnv_layout_dir)"
eval "$(nix print-dev-env --no-update-lock-file --no-write-lock-file --profile $(direnv_layout_dir)/flake-profile)"
} || use nix
export GUILE_LOAD_PATH="$HOME/src/guix-channel/:$GUILE_LOAD_PATH"
use guix

export RUST_SRC_PATH="$HOME/src/rust/library"

export LD_LIBRARY_PATH=$LIBRARY_PATH
rm /tmp/cc
ln -s $(guix build clang)/bin/clang /tmp/cc
export PATH=$PATH:/tmp
export LIBCLANG_PATH=$(guix build clang)/lib
unset EMACSLOADPATH
unset EMACSNATIVELOADPATH
11 changes: 9 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,22 @@ jobs:
bin_version=$version
echo "version=$version" >> $GITHUB_ENV
echo "bin_version=$bin_version" >> $GITHUB_ENV
./build_emacs_ng.sh $bin_version
./admin/build_emacs_ng.sh $bin_version
- name: Build project with webrender
if: ${{ matrix.build == 'webrender' }}
run: |
version=${{ needs.prepare_env.outputs.version }}
bin_version=$version.webrender
echo "version=$version" >> $GITHUB_ENV
echo "bin_version=$bin_version" >> $GITHUB_ENV
./build_emacs_ng.sh $bin_version --with-webrender --with-winit
./admin/build_emacs_ng.sh $bin_version --with-webrender --with-winit
- name: Vendor Cargo sources
run: |
version=${{ needs.prepare_env.outputs.version }}
bin_version=$version.webrender
echo "version=$version" >> $GITHUB_ENV
echo "bin_version=$bin_version" >> $GITHUB_ENV
./admin/vendor_cargo_source.sh $bin_version
- name: Reduce cache
continue-on-error: true
run: |
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions admin/vendor_cargo_source.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

if [[ -z $@ ]]; then
echo "Usage: ./vendor_cargo_source.sh <emacs_version>"
fi

mkdir -p .cargo
cargo vendor ./third_party/rust --respect-source-config > \
.cargo/config.toml
git add -f ./third_party/rust
git add .cargo/config.toml
git commit --no-verify -m "Vendor Cargo Source"

prefix=emacs-ng_$1

git config tar.tar.xz.command "xz -c"
git archive --prefix=$prefix/ HEAD -o $prefix.tar.xz

0 comments on commit 0518391

Please sign in to comment.