Skip to content

Commit

Permalink
Create release-drafter (#2)
Browse files Browse the repository at this point in the history
* Create release-drafter-ci
* Use docker build multi image
  • Loading branch information
shiipou authored May 14, 2020
1 parent 71e219f commit 084e17c
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 14 deletions.
18 changes: 18 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name-template: 'v$NEXT_PATCH_VERSION 🌈'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
## Changes
$CHANGES
13 changes: 13 additions & 0 deletions .github/workflows/release-drafter-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Release Drafter
on:
push:
branches:
- master
jobs:
build:
name: Release Drafter
runs-on: ubuntu-latest
steps:
- uses: toolmantim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93 changes: 79 additions & 14 deletions .github/workflows/vi-v-build-action.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,92 @@
name: Build Vi-v

on:
- push
- pull_request
push:
pull_request:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 0 * * 0'

jobs:

build:
name: Build with ${{ matrix.os }}
runs-on:
- ${{ matrix.os }}
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [X64]
platform:
- amd64
- arm64
- arm/v7
- ppc64le
- s390x
- 386
steps:
- name: Checkout
- name: Checkout code from Git repository
uses: actions/checkout@v2
- name: Set up V version master
uses: nocturlab/setup-vlang-action@v1

- id: buildx
name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
v-version: master
id: v
- name: Build Vi-v
buildx-version: latest
qemu-version: latest

- name: Log into registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin

- name: Build & Push
run: |
IMAGE_ID=shiishii/labo
# Change all uppercase to lowercase
IMAGE_ID=$(echo ${IMAGE_ID} | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo ${VERSION} | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
if [ -n "${{ matrix.platform }}" ]; then
_platform=${{ matrix.platform }}
VERSION="${VERSION}-${_platform//\/}"
fi
echo "IMAGE_ID=${IMAGE_ID}"
echo "VERSION=${VERSION}"
docker buildx build \
--platform linux/${{ matrix.platform }} \
--tag ${IMAGE_ID}:${VERSION} \
--file ./Dockerfile \
--output type=image,push=true .

publish:
name: Publish
runs-on: ubuntu-latest
needs: build
env:
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
- name: Get current branch
run: |
make
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')
if [ "${BRANCH_NAME}" = "master" ]; then
BRANCH_NAME="latest"
fi
echo "::set-env name=BRANCH_NAME::${BRANCH_NAME}"
- run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
docker manifest create shiishii/labo:${{ env.BRANCH_NAME }} \
shiishii/labo:${{ env.BRANCH_NAME }}-amd64 \
shiishii/labo:${{ env.BRANCH_NAME }}-arm64 \
shiishii/labo:${{ env.BRANCH_NAME }}-armv7 \
shiishii/labo:${{ env.BRANCH_NAME }}-ppc64le \
shiishii/labo:${{ env.BRANCH_NAME }}-s390x \
shiishii/labo:${{ env.BRANCH_NAME }}-386
docker manifest push shiishii/labo:${{ env.BRANCH_NAME }}

0 comments on commit 084e17c

Please sign in to comment.