Skip to content

Commit

Permalink
chore: use a seperate workspace than used by the local user
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Oct 29, 2020
1 parent 58b4883 commit 620d3cc
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- id: set_package_info
run: docker run --rm -v $(pwd):/home/rust/src -t pactfoundation/pact-js-musl:${{ matrix.node-version }}
run: docker run --rm -e LOCAL_USER_ID=`id -u $USER` -v $(pwd):/home/rust/src -t pactfoundation/pact-js-musl:${{ matrix.node-version }}
- name: Upload Release Assets
id: upload-release-asset
uses: svenstaro/upload-release-action@v2
Expand Down
15 changes: 9 additions & 6 deletions native/Dockerfile.musl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ FROM alpine:latest
ARG NODE_VERSION=14

RUN addgroup -S -g 1000 rust && adduser -S -u 1000 rust -G rust
RUN apk add --no-cache curl bash python3 gcc musl-dev libstdc++ ca-certificates openssl ncurses coreutils python2 make g++ libgcc linux-headers grep util-linux binutils findutils perl
RUN apk add --no-cache curl bash python3 gcc musl-dev libstdc++ ca-certificates openssl ncurses coreutils python2 make \
g++ libgcc linux-headers grep util-linux binutils findutils perl gnupg

USER rust
RUN mkdir -p /home/rust/bin /home/rust/src
RUN mkdir -p /workspace
RUN chmod 777 /workspace
# USER rust
RUN mkdir -p /home/rust/bin
RUN touch /home/rust/.bashrc && touch /home/rust/.profile
ENV HOME /home/rust

Expand All @@ -27,6 +30,6 @@ ENV RUSTONIG_STATIC_LIBONIG=1
ENV RUSTONIG_SYSTEM_LIBONIG=0
ENV OPENSSL_STATIC=1

COPY build-native.sh /home/rust/bin/
WORKDIR /home/rust/src
ENTRYPOINT [ "/home/rust/bin/build-native.sh" ]
COPY build-native.sh entrypoint.sh /home/rust/bin/
WORKDIR /workspace
ENTRYPOINT [ "/home/rust/bin/entrypoint.sh" ]
3 changes: 3 additions & 0 deletions native/build-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ VERSION=$(grep '\"version\"' package.json | grep -E -o "([0-9\.]+(-[a-z\.0-9]+)?
NODE_VERSION=$(node --version)
echo "--> Releasing native library for version ${VERSION} and Node version ${NODE_VERSION}"

pwd
ls -la

npm install
npm run build:v3
rm -rf native/target
Expand Down
16 changes: 16 additions & 0 deletions native/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash -e

. $NVM_DIR/nvm.sh

VERSION=$(grep '\"version\"' package.json | grep -E -o "([0-9\.]+(-[a-z\.0-9]+)?)")
NODE_VERSION=$(node --version)
echo "--> Releasing native library for version ${VERSION} and Node version ${NODE_VERSION}"

pwd
ls -la

npm install
npm run build:v3
rm -rf native/target
npm run package
echo "::set-output name=packageJson::$(node ./scripts/native-lib-details.js)"

0 comments on commit 620d3cc

Please sign in to comment.