Files
Macro-Deck/.github/workflows/create-release.yml
2023-06-06 22:14:02 +02:00

88 lines
2.5 KiB
YAML

name: Create Release
on:
workflow_dispatch:
inputs:
release-type:
type: choice
options:
- minor_beta
- major_beta
- patch
- minor
- major
required: true
jobs:
tests:
name: Execute Tests
#uses: ./.github/workflows/tests.yml
#secrets: inherit
runs-on: ubuntu-latest
steps:
- run: echo ""
get-version:
name: "Get Version"
runs-on: ubuntu-latest
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, tests]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
github-token: "${{secrets.GITHUB_TOKEN}}"
- name: Update CSProj Version
run: |
sed -i 's/<Version>.*<\/Version>/<Version>${{ needs.get-version.steps.fetch_version.output.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.steps.fetch_version.output.version }}
release-github:
name: "Release GitHub"
runs-on: ubuntu-latest
needs: [tests, bump-version]
steps:
- name: "Create Release"
uses: Macro-Deck-App/Actions/create-github-release@main
id: create_release
with:
github-token: "${{secrets.GITHUB_TOKEN}}"
is-beta: ${{ steps.fetch_version.outputs.is-beta }}
version: ${{ steps.fetch_version.outputs.version }}
release-windows:
name: Build and Push Macro Deck for Windows
uses: ./.github/workflows/build-push-windows.yml
needs: release-github
secrets: inherit
with:
version: ${{ needs.release-github.steps.fetch_version.outputs.version }}
upload-url: ${{ needs.release-github.steps.create_release.outputs.upload-url }}
notify:
name: "Notify"
runs-on: ubuntu-latest
needs: [release-github, release-windows]
steps:
- uses: Macro-Deck-App/Actions/discord-notify-release@main
with:
version: ${{ needs.release-github.steps.fetch_version.outputs.version }}
is-beta: ${{ needs.release-github.steps.fetch_version.outputs.is-beta }}
webhook-token: ${{ secrets.WEBHOOK_KEY }}