diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..b2a4512 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,20 @@ +changelog: + categories: + - title: 🎉 Exciting New Features + labels: + - feature + - title: 🚀 Improvements + labels: + - improvement + - title: 🛠 Breaking Changes + labels: + - breaking-change + - title: 🐞 Bug Fixes + labels: + - bugfix + - title: 👒 Dependencies + labels: + - dependencies + - title: 🚀 Other Changes + labels: + - "*" diff --git a/.github/workflows/check-version.yml b/.github/workflows/check-version.yml new file mode 100644 index 0000000..c76d42f --- /dev/null +++ b/.github/workflows/check-version.yml @@ -0,0 +1,23 @@ +name: Build Windows Installer + +on: + workflow_call: + inputs: + version: + description: 'Version' + required: true + type: string + +jobs: + check-release-name: + runs-on: ubuntu-latest + + steps: + - name: Check version on update API + run: | + VERSION_CHECK=$(curl -s "https://update.api.macro-deck.app/versionname/validate/${{ inputs.version }}") + + if [[ "$VERSION_CHECK" != "true" ]]; then + echo "Version '${{ inputs.version }}' is not valid according to the update API." + exit 1 + fi diff --git a/.github/workflows/release-created.yml b/.github/workflows/release-created.yml new file mode 100644 index 0000000..970f43e --- /dev/null +++ b/.github/workflows/release-created.yml @@ -0,0 +1,27 @@ +name: Release Created + +on: + release: + types: [published] + +jobs: + check_version: + name: Check Version Name + uses: ./.github/workflows/check-version.yml + with: + version: ${{ github.event.release.name }} + + tests: + name: Execute Tests + needs: [check_version] + uses: ./.github/workflows/tests.yml + secrets: inherit + + release-windows: + name: Build and Push Macro Deck for Windows + uses: ./.github/workflows/build-push-windows.yml + needs: [check_version, tests] + secrets: inherit + with: + version: ${{ github.event.release.name }} + channel: ${{ github.event.release.prerelease && 'Preview' || 'Release' }}