Skip to content

Merge pull request #4 from nmlynch94/test-pr #7

Merge pull request #4 from nmlynch94/test-pr

Merge pull request #4 from nmlynch94/test-pr #7

Workflow file for this run

on:
push:
# Sequence of patterns matched against refs/tags
branches: main
workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab
name: Create Release
permissions:
contents: write
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Get tags
run: git fetch --tags origin
- name: Set variables
id: variables
run: |
LAST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
MAJOR=$(echo "$LAST_TAG" | cut -d. -f1)
MINOR=$(echo "$LAST_TAG" | cut -d. -f2)
PATCH=$(echo "$LAST_TAG" | cut -d. -f3)
NEW_VERSION="$MAJOR.$MINOR.$((PATCH+1))"
echo "NEW_TAG=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "APP_NAME=$(basename $(pwd))" >> $GITHUB_OUTPUT
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y \
flatpak \
flatpak-builder
- name: Build the flatpak bundle
run: |
chmod +x build.sh
./build.sh
flatpak build-bundle ~/.local/share/flatpak/repo ${{ steps.variables.outputs.APP_NAME }}.flatpak ${{ steps.variables.outputs.APP_NAME }}
- name: Tag this branch with incremented release version
id: new-tag
run: |
git tag ${{ steps.variables.outputs.NEW_TAG }}
git push "https://$GITHUB_ACTOR:${{ secrets.ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" --tags
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.variables.outputs.APP_NAME }}.flatpak
tag_name: ${{ steps.variables.outputs.NEW_TAG }}