Draft Release Flathub #2
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: Draft Release Flathub | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
ref_name: | |
description: 'Release Flatpak' | |
required: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} | |
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} | |
RELEASE_VERSION: ${{ github.ref_name }} | |
jobs: | |
draft-releases: | |
runs-on: ubuntu-latest | |
steps: | |
- name: echo ref name. | |
run: echo "tag name ${{ github.ref_name }}" | |
- name: Checkout repository. | |
uses: actions/checkout@v3 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Reconfigure git to use HTTP authentication | |
run: > | |
git config --global url."https://github.com/".insteadOf | |
ssh://[email protected]/ | |
- name: Install modules. | |
run: yarn install | |
- name: Checkout flathub repository. | |
run: git clone https://github.com/flathub/com.heroicgameslauncher.hgl.git | |
- name: Update flathub release | |
run: export RELEASE_VERSION=${{ github.ref_name }} && yarn release:updateFlathub:ci | |
- name: Branch flathub repo | |
run: git checkout -b "${{ github.ref_name }}" | |
working-directory: ./com.heroicgameslauncher.hgl | |
- name: Commit files to com.heroicgameslauncher.hgl | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Flavio F Lima" | |
git commit -a -m "changes for ${{ github.ref_name }}" | |
working-directory: ./com.heroicgameslauncher.hgl | |
- name: Push updated flathub branch | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.WORKFLOW_TOKEN }} | |
branch: ${{ github.ref_name }} | |
directory: com.heroicgameslauncher.hgl | |
repository: flathub/com.heroicgameslauncher.hgl | |
- name: PR to flathub repo | |
run: sleep 5 && gh pr create --title ${{ github.ref_name }} --body ${{ github.ref_name }} --base master --head ${{ github.ref_name }} | |
working-directory: ./com.heroicgameslauncher.hgl |