Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

workflow: Upload release assets #719

Merged
merged 2 commits into from
Nov 4, 2020
Merged
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
44 changes: 44 additions & 0 deletions .github/workflows/upload-release-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Upload release assets

on:
workflow_dispatch:
# Enable manual trigger of this action.
inputs:
tag:
description: Git tag to checkout.
required: true

env:
DOCKER_TTY: "" # using `docker run -t` seems to not work in github actions, maybe related to https://github.com/actions/runner/issues/241
REL_TAG: ${{ github.event.inputs.tag }}

jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.REL_TAG }}
- name: Login to container registry
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
- name: Build binaries and push sandbox image
run: make release
- name: Prepare assets
run: |
mkdir -p release
cp bin/releases/${{ env.REL_TAG }}/amd64/ignite release/ignite-amd64
cp bin/releases/${{ env.REL_TAG }}/amd64/ignited release/ignited-amd64
cp bin/releases/${{ env.REL_TAG }}/arm64/ignite release/ignite-arm64
cp bin/releases/${{ env.REL_TAG }}/arm64/ignited release/ignited-arm64
- name: Upload assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.REL_TAG }}
file_glob: true
file: release/*
overwrite: true
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ endif

SHELL:=/bin/bash
# Set the command for running `docker`
# -- allows user to override for things like sudo usage or container images
# -- allows user to override for things like sudo usage or container images
DOCKER := docker
# DOCKER_TTY defaults for a nice docker buildkit tty experience on dev laptops -- can be disabled in CI if no tty available
DOCKER_TTY ?= -t

# Set the first containerd.sock that successfully stats -- fallback to the docker4mac default
CONTAINERD_SOCK := $(shell \
$(DOCKER) run -i --rm \
Expand Down Expand Up @@ -99,7 +102,7 @@ local: # Do not use directly -- use $(GO_MAKE_TARGET)
$(COMMAND)
go-in-docker: # Do not use directly -- use $(GO_MAKE_TARGET)
mkdir -p $(CACHE_DIR)/go $(CACHE_DIR)/cache
$(DOCKER) run -it --rm \
$(DOCKER) run -i $(DOCKER_TTY) --rm \
-v $(CACHE_DIR)/go:/go \
-v $(CACHE_DIR)/cache:/.cache/go-build \
-v $(shell pwd):/go/src/${PROJECT} \
Expand Down Expand Up @@ -208,7 +211,7 @@ api-doc:
mv bin/tmp/${GROUPVERSION}/*.go $(shell pwd)/pkg/apis/${GROUPVERSION}/
rm -r bin/tmp/${GROUPVERSION}
# Format the docs with pandoc
$(DOCKER) run -it --rm \
$(DOCKER) run -i $(DOCKER_TTY) --rm \
-v $(shell pwd):/data \
-u $(shell id -u):$(shell id -g) \
pandoc/core:2.10 `# TODO: let's try bumping this image tag in 2021` \
Expand Down
4 changes: 3 additions & 1 deletion hack/release-common.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash

DOCKER_TTY="${DOCKER_TTY:+"-t"}"

if [[ ! -f bin/gren_token ]]; then
echo "File bin/gren_token is needed; should contain a Github token with repo access"
exit 1
fi

run_gren() {
docker run -it \
docker run -i ${DOCKER_TTY} \
-v $(pwd):/data \
-w /data \
-u $(id -u):$(id -g) \
Expand Down
4 changes: 3 additions & 1 deletion images/kernel/upgrade-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

KERNEL_BUILDER_IMAGE=luxas/kernel-builder:gcc-7

DOCKER_TTY="${DOCKER_TTY:+"-t"}"

if [[ $# != 2 ]]; then
echo "Usage: $0 [FROM] [TO]"
exit 1
Expand All @@ -22,7 +24,7 @@ if [[ ${FROM} != ${TO} ]]; then
fi

docker pull ${KERNEL_BUILDER_IMAGE}
docker run -it \
docker run -i ${DOCKER_TTY} \
${ARCH_PARAMETER} \
-v $(pwd)/${TO}:/tmp/.config \
${KERNEL_BUILDER_IMAGE} /bin/bash -c "\
Expand Down