buildci: generalise for all push events and PRs
This means that tags are included now Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
4
.github/buildci.sh
vendored
4
.github/buildci.sh
vendored
@@ -16,7 +16,7 @@ setup_cross_compiling() {
|
|||||||
# Building for the given architecture
|
# Building for the given architecture
|
||||||
build_for_arch() {
|
build_for_arch() {
|
||||||
__ARCH=$1
|
__ARCH=$1
|
||||||
__SHA=$2
|
__REF=$2
|
||||||
|
|
||||||
# Statically compile
|
# Statically compile
|
||||||
case "$__ARCH" in \
|
case "$__ARCH" in \
|
||||||
@@ -29,5 +29,5 @@ build_for_arch() {
|
|||||||
|
|
||||||
# Export them artifacts
|
# Export them artifacts
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
cp -av /home/runner/.cargo/bin/bin "artifacts/bin-$__SHA-$__TARGET"
|
cp -av /home/runner/.cargo/bin/bin "artifacts/bin-$__REF-$__TARGET"
|
||||||
}
|
}
|
||||||
14
.github/workflows/buildci.yml
vendored
14
.github/workflows/buildci.yml
vendored
@@ -1,12 +1,6 @@
|
|||||||
name: Build CI
|
name: Build CI
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "*"
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -31,8 +25,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
|
[ $GITHUB_REF_TYPE = "branch" ] && \
|
||||||
|
export __REF=${GITHUB_SHA::7} || \
|
||||||
|
export __REF=$GITHUB_REF_NAME
|
||||||
|
|
||||||
source ./.github/buildci.sh
|
source ./.github/buildci.sh
|
||||||
build_for_arch ${{ matrix.arch }} ${GITHUB_SHA::7}
|
build_for_arch ${{ matrix.arch }} $__REF
|
||||||
|
|
||||||
- name: Export artifacts
|
- name: Export artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
|||||||
Reference in New Issue
Block a user