Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

SWAN CI/CD pipeline #52

SWAN CI/CD pipeline

SWAN CI/CD pipeline #52

# This is a basic workflow to help you get started with Actions
# author: Omar.Zapata@cern.ch 2020
name: SWAN CI/CD pipeline
on:
workflow_dispatch:
inputs:
package:
description: 'Package Name'
required: true
default: ''
version:
description: 'Package Version'
required: true
default: ''
jobs:
update-package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
ref: master
- name: Update package version
run: |
echo "Updating information for package = ${{ github.event.inputs.package }} version = ${{ github.event.inputs.version }}"
export PKG_NAME_LOWER=$(echo " ${{ github.event.inputs.package }}" | tr '[:upper:]' '[:lower:]')
export PKG_VER=$(echo ${{ github.event.inputs.version }} | sed -e "s/v//g")
sed -i "s/\( $PKG_NAME_LOWER==*\)[^ ]*/\1$PKG_VER/" Dockerfile
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Updated package ${{ github.event.inputs.package }} to version ${{ github.event.inputs.version }}"
branch: '${{ github.event.inputs.package }}-${{ github.event.inputs.version }}'
delete-branch: true
title: "Updated package ${{ github.event.inputs.package }} to version ${{ github.event.inputs.version }}"