Update mamolinux/stable branch #904
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automatically fetch and merge latest tag to mamolinux/stable for new stable releases | |
name: Update mamolinux/stable branch | |
# Controls when the action will run. | |
on: | |
push: | |
tags: ['*'] | |
workflow_dispatch: # on button click | |
inputs: | |
branch: | |
description: 'Branch to merge to' | |
required: true | |
default: 'mamolinux/stable' # set the branch to merge to | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "sync-new-release" | |
sync-new-release: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
# Set default branches when run as scheduled job | |
- name: Set the branches | |
env: | |
DEFAULT_UPSTREAM_BRANCH: 'main' # set the upstream branch to merge from | |
DEFAULT_BRANCH: 'mamolinux/stable' # set the branch to merge to | |
run: | | |
git checkout ${{ env.DEFAULT_UPSTREAM_BRANCH }} | |
echo "latest-tag=`git describe --abbrev=0 --tags`" >> $GITHUB_ENV | |
echo "branch=${{ github.event.inputs.branch || env.DEFAULT_BRANCH }}" >> $GITHUB_ENV | |
- name: Set Git config | |
run: | | |
git config --local user.email "actions@github.com" | |
git config --local user.name "Github Actions" | |
- name: Update mamolinux/stable for new release | |
run: | | |
export DEBFULLNAME="Himadri Sekhar Basu" | |
export DEBEMAIL="mamolinux@mamolinux.org" | |
git checkout -b ${{ env.branch }} ${{ env.latest-tag }} | |
sudo apt-get -y update | |
sudo apt-get -y install debhelper devscripts | |
REL_VER=$(grep "^readonly VERSION" deb-get | cut -d'"' -f2) | |
dch -v "${REL_VER}-1" --distribution=unstable "New upstream release." | |
git push -f origin ${{ env.branch }} |