name: Create new release on: workflow_dispatch: inputs: new_version: description: 'New version' required: true type: string ref: description: 'Commit hash (optional)' required: false default: '' type: string jobs: test-new-version: runs-on: ubuntu-latest steps: - name: Verify new version format run: | if [[ "${{ inputs.new_version }}" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then echo "New version looks okay"; else echo "Invalid version format"; exit 1 fi build: runs-on: ubuntu-latest env: FBT_NO_SYNC: "true" TARGETS: f7 DEFAULT_TARGET: f7 steps: - name: 'Decontaminate previous build leftovers' run: | if [ -d .git ]; then git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)" fi - uses: actions/checkout@v3 with: ref: "${{inputs.ref}}" fetch-depth: 0 submodules: 'recursive' - name: Build run: ./build.ps1 shell: pwsh - uses: ncipollo/release-action@v1.12.0 with: artifacts: "build/*.fap,build/checksums.sha256" bodyFile: ".github/release-body.md" artifactErrorsFailBuild: true updateOnlyUnreleased: true allowUpdates: true removeArtifacts: true draft: true tag: "v${{ inputs.new_version }}" commit: "${{inputs.ref}}"