Generate Snap #11
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
--- | |
name: Generate Snap | |
on: | |
workflow_dispatch: | |
inputs: | |
snap_version: | |
description: 'Version number of release to snap' | |
required: true | |
jobs: | |
generate-formula: | |
name: Generate a snap file | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set Version | |
run: | | |
input_version="${{ github.event.inputs.snap_version }}" | |
if [ "${#input_version}" -eq "0" ]; then | |
echo "snap_version=v0.0.1" >> $GITHUB_ENV | |
else | |
echo "snap_version=$input_version" >> $GITHUB_ENV | |
fi | |
- run: echo 'Release ${{ env.snap_version }}' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create the snap from the template | |
run: | | |
cp template/snapcraft.yaml snapcraft.yaml | |
cat snapcraft.yaml | |
sed -i 's/:snap_version/${{ env.snap_version }}/' snapcraft.yaml | |
echo " --- " | |
cat snapcraft.yaml | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: Update snap to alienware-cli-${{ env.snap_version }} | |
committer: GitHub <noreply@github.com> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
signoff: false | |
branch: alienware-cli-${{ env.snap_version }} | |
base: main | |
delete-branch: true | |
title: 'Update of snap for alienware-cli tag ${{ env.snap_version }}' | |
body: | | |
Update snap for ${{ env.snap_version }} | |
- Change to version number | |
- Change of source file link | |
- Auto-generated by workflow | |
labels: | | |
alienware | |
assignees: a1ecbr0wn | |
draft: false |