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 e2f5284
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 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
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

build:
needs: prepare_env
name: Build and release
name: Build/Vendor and release
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -78,15 +78,16 @@ jobs:
bin_version=$version
echo "version=$version" >> $GITHUB_ENV
echo "bin_version=$bin_version" >> $GITHUB_ENV
./build_emacs_ng.sh $bin_version
./admin/vendor_cargo_source.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: Reduce cache
continue-on-error: true
run: |
Expand Down Expand Up @@ -115,7 +116,7 @@ jobs:
draft: false
prerelease: ${{ needs.prepare_env.outputs.prerelease }}
artifactErrorsFailBuild: true
artifacts: ./emacs-ng_${{ env.bin_version }}_${{ needs.prepare_env.outputs.arch }}.deb
artifacts: ./emacs-ng_${{ env.bin_version }}_${{ needs.prepare_env.outputs.arch }}.deb, ./emacs-ng_${{ env.bin_version }}.tar.xz
artifactContentType: application/vnd.debian.binary-package
token: ${{ secrets.GITHUB_TOKEN }}
- name: Do upload to release
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions admin/vendor_cargo_source.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/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 config --global user.email "[email protected]"
git config --global user.name "github bot"
git config tar.tar.xz.command "xz -c"
git add -f ./third_party/rust
git add .cargo/config.toml
git commit --no-verify -m "Vendor Cargo Source"

prefix=emacs-ng_$1

git archive --prefix=$prefix/ HEAD -o $prefix.tar.xz

0 comments on commit e2f5284

Please sign in to comment.