Skip to content

Merge pull request #12 from vim-denops/support-denops-v7 #151

Merge pull request #12 from vim-denops/support-denops-v7

Merge pull request #12 from vim-denops/support-denops-v7 #151

Workflow file for this run

name: Build
on:
push:
branches:
- main
workflow_dispatch:
inputs:
denops_version:
description: Denops version
required: false
default: "main"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get DENOPS_VERSION
id: vars
run: |
if [[ -z "${{ github.event.inputs.denops_version }}" ]]; then
echo '::set-output name=DENOPS_VERSION::main'
else
echo '::set-output name=DENOPS_VERSION::${{ github.event.inputs.denops_version }}'
fi
shell: bash
- name: Build and Push to ghcr.io
env:
DENOPS_VERSION: ${{ steps.vars.outputs.DENOPS_VERSION }}
shell: bash
run: |
make DENOPS_VERSION=$DENOPS_VERSION build
if [[ $DENOPS_VERSION == v* ]]; then
# Full version string
make DOCKER_TAG=$DENOPS_VERSION push
# vX.Y.Z -> vX.Y (major and minor)
export DOCKER_TAG_MINOR=$(echo $DENOPS_VERSION | sed -r 's/(v[0-9]+)(\.[0-9]+)(\.[0-9]+)/\1\2/')
make DOCKER_TAG=$DOCKER_TAG_MINOR push
# vX.Y.Z -> vX (major only)
export DOCKER_TAG_MAJOR=$(echo $DENOPS_VERSION | sed -r 's/(v[0-9]+)(\.[0-9]+)(\.[0-9]+)/\1/')
make DOCKER_TAG=$DOCKER_TAG_MAJOR push
fi
make DOCKER_TAG=latest push