adds version.sh to do some version manipulation during build
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
c6435bbfcf
commit
e7e0720b54
@ -21,6 +21,7 @@ steps:
|
||||
- name: build amd64
|
||||
image: rust:1.73-alpine
|
||||
commands:
|
||||
- ./version.sh
|
||||
- apk add --no-cache musl-dev gcc-aarch64-none-elf
|
||||
- mkdir /artifacts/mouse-amd64
|
||||
- cp LICENSE.txt /artifacts/mouse-amd64/
|
||||
@ -35,9 +36,6 @@ steps:
|
||||
- cd /artifacts && tar -cvzf mouse-amd64.tar.gz mouse-amd64/*
|
||||
- cd /artifacts && tar -cvzf mouse-arm64.tar.gz mouse-arm64/*
|
||||
environment:
|
||||
CARGO_PKG_VERSION: ${DRONE_TAG##v}
|
||||
CARGO_PKG_LICENSE: "Mozilla Public License Version 2.0"
|
||||
CARGO_PKG_LICENSE_FILE: LICENSE.txt
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: /usr/bin/aarch64-none-elf-gcc
|
||||
volumes:
|
||||
- name: artifacts
|
||||
|
13
version.sh
Executable file
13
version.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# Get last created tag
|
||||
LTCOMMIT=$(git rev-list --abbrev-commit --tags --max-count=1)
|
||||
LTAG=$(git describe --abbrev=0 --tags ${LTCOMMIT} 2>/dev/null || true)
|
||||
ADC=${DRONE_COMMIT:0:7}
|
||||
|
||||
if [[ "${LTCOMMIT}" == "${ADC}" ]]; then
|
||||
VERSION="${DRONE_TAG##v}"
|
||||
else
|
||||
VERSION="${LTAG}-next-${ADV}"
|
||||
fi
|
||||
|
||||
sed -i "s/0\\.0\\.0/${VERSION}/" Cargo.toml
|
Loading…
Reference in New Issue
Block a user