mirror of
https://github.com/Macro-Deck-App/Macro-Deck.git
synced 2026-05-07 05:59:22 +08:00
76 lines
2.2 KiB
YAML
76 lines
2.2 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
release-type:
|
|
type: choice
|
|
options:
|
|
- minor_beta
|
|
- major_beta
|
|
- patch
|
|
- minor
|
|
- major
|
|
required: true
|
|
|
|
jobs:
|
|
get-version:
|
|
name: "Get Version"
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.fetch_version.outputs.version }}
|
|
is-beta: ${{ steps.fetch_version.outputs.is-beta }}
|
|
steps:
|
|
- name: Fetch Version From API
|
|
uses: Macro-Deck-App/Actions/fetch-version@main
|
|
id: fetch_version
|
|
with:
|
|
release-type: ${{ github.event.inputs.release-type }}
|
|
|
|
bump-version:
|
|
name: "Bump Version"
|
|
runs-on: ubuntu-latest
|
|
needs: [get-version]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
github-token: ${{ secrets.PAT }}
|
|
|
|
- name: Update CSProj Version
|
|
run: |
|
|
sed -i 's/<Version>.*<\/Version>/<Version>${{ needs.get-version.outputs.version }}<\/Version>/' ./MacroDeck/MacroDeck.csproj
|
|
git add ./MacroDeck/MacroDeck.csproj
|
|
|
|
- name: Commit Changes
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
commit_message: Bump Version to ${{ needs.get-version.outputs.version }}
|
|
github-token: ${{ secrets.PAT }}
|
|
|
|
release-github:
|
|
name: "Release GitHub"
|
|
runs-on: ubuntu-latest
|
|
needs: [get-version, bump-version]
|
|
|
|
steps:
|
|
- name: "Create Release"
|
|
uses: Macro-Deck-App/Actions/create-github-release@main
|
|
id: create_release
|
|
with:
|
|
github-token: "${{secrets.PAT}}"
|
|
is-beta: ${{ needs.get-version.outputs.is-beta }}
|
|
version: ${{ needs.get-version.outputs.version }}
|
|
|
|
create-pull-request:
|
|
name: "Create pull-request back to develop"
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
needs: [get-version, bump-version, release-github]
|
|
steps:
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v5
|
|
with:
|
|
branch: main
|
|
title: Bump Macro Deck version to ${{ needs.get-version.outputs.version }}
|
|
body: Bumps the version of Macro Deck to ${{ needs.get-version.outputs.version }} |