Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare for musl releases #285

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 84 additions & 17 deletions .concourse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ resources:
source:
repository: quay.io/drahnr/rust-glibc-builder

- name: env-musl
type: registry-image
source:
repository: quay.io/drahnr/rust-musl-builder

jobs:
####################################################################################
# P U L L - R E Q U E S T
Expand Down Expand Up @@ -705,25 +710,61 @@ jobs:
"${EXE}" spellcheck -vvv
dir: copy

- name: publish-github-release
- name: github-release
build_logs_to_retain: 5
public: false
serial: true
plan:
- get: env-glibc
- get: env-musl
- get: git-repo
resource: git-tag-resource
trigger: true

- task: github-release
- task: artifact-release-musl
timeout: 40m
image: env-musl
config:
platform: linux
inputs:
- name: git-repo
outputs:
- name: artifact-musl
caches:
- path: cargo
run:
path: sh
args:
- -exc
- |
export RUST_BACKTRACE=full
export CARGO_HOME="$(pwd)/../cargo"
whoami
chown $(whoami): -Rf ${CARGO_HOME} .

build() {
DEST=$1
TARGET=$2;
EXT=$3;
echo "Prepping ${TARGET} ..."
cargo build --release --target "${TARGET}"
cp -vf "target/${TARGET}/release/cargo-spellcheck${EXT}" "${DEST}"/${TARGET}-cargo-spellcheck-$(cat ./.git/ref)"${EXT}"
echo "Prepped ${TARGET} ."
}

build ../artifact-musl x86_64-alpine-linux-musl
dir: git-repo

- task: artifact-release-glibc
timeout: 40m
image: env-glibc
config:
platform: linux
inputs:
- name: git-repo
outputs:
- name: release-info
- name: artifact-glibc
- name: artifact-win
caches:
- path: cargo
run:
Expand All @@ -733,7 +774,45 @@ jobs:
- |
export RUST_BACKTRACE=full
export CARGO_HOME="$(pwd)/../cargo"
sudo chown $(whoami): -Rf ${CARGO_HOME} .
sudo chown $(whoami): -Rf ../artifact-glibc ../artifact-win ${CARGO_HOME} .

build() {
DEST=$1
TARGET=$2;
EXT=$3;
echo "Prepping ${TARGET} ..."
rustup target add "${TARGET}"
cargo build --release --target "${TARGET}" && \
sudo cp -vf "target/${TARGET}/release/cargo-spellcheck${EXT}" "${DEST}"/${TARGET}-cargo-spellcheck-$(cat ./.git/ref)"${EXT}"
echo "Prepped ${TARGET} ."
}

build ../artifact-glibc x86_64-unknown-linux-gnu
build ../artifact-win x86_64-pc-windows-gnu .exe

dir: git-repo


- task: github-release
timeout: 40m
image: env-glibc
config:
platform: linux
inputs:
- name: git-repo
- name: artifact-musl
- name: artifact-glibc
- name: artifact-win
outputs:
- name: release-info
caches:
- path: cargo
run:
path: sh
args:
- -exc
- |
sudo chown $(whoami): -Rf .

export RI_BASE_DIR="../release-info"
export RI_ARTIFACTS_DIR="${RI_BASE_DIR}/artifacts"
Expand All @@ -744,7 +823,6 @@ jobs:
sudo install -o $(whoami) -d "${RI_BASE_DIR}" || echo "failed to create dir"
sudo install -o $(whoami) -d "${RI_ARTIFACTS_DIR}" || echo "failed to create dir"


git rev-parse HEAD > "${RI_COMMITISH_FILE}"
#git log -n 1 --format="%h" HEAD > "../${RI_COMMITISH_FILE}"
cat "${RI_COMMITISH_FILE}"
Expand All @@ -757,18 +835,7 @@ jobs:
echo "cargo-spellcheck-$(cat ./.git/ref)" > "${RI_NAME_FILE}"
cat "${RI_NAME_FILE}"

build() {
TARGET=$1;
EXT=$2;
echo "Prepping ${TARGET} ..."
rustup target add "${TARGET}"
cargo build --release --target "${TARGET}" && \
cp -vf "target/${TARGET}/release/cargo-spellcheck${EXT}" "${RI_ARTIFACTS_DIR}"/${TARGET}-$(cat "${RI_NAME_FILE}")"${EXT}"
echo "Prepped ${TARGET} ."
}

build x86_64-unknown-linux-gnu
build x86_64-pc-windows-gnu .exe
cp -vf ../artifact*/* "${RI_ARTIFACTS_DIR}/"

dir: git-repo

Expand Down
Loading