Automation to Make Releases #1
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: Create Release | |
on: | |
workflow_run: | |
workflows: ["Linpad application"] | |
types: | |
- completed | |
jobs: | |
create_release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Get current version | |
id: get_version | |
run: | | |
# Fetch the latest tag | |
TAG=$(git describe --tags --abbrev=0) | |
# Extract the version numbers | |
VERSION=${TAG//v/} | |
# Split into an array | |
IFS='.' read -r -a VERSION_ARRAY <<< "$VERSION" | |
# Increment the last digit for beta versions | |
LAST=${VERSION_ARRAY[2]} | |
NEW_LAST=$((LAST + 1)) | |
NEW_VERSION="v${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}.$NEW_LAST-beta" | |
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.NEW_VERSION }} | |
release_name: ${{ env.NEW_VERSION }} | |
body: "Release of Linpad application version ${{ env.NEW_VERSION }}" | |
files: output/linpad.deb | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |