diff --git a/.github/scripts/changelog.ps1 b/.github/scripts/changelog.ps1 index f1b4b95..84b9e5a 100644 --- a/.github/scripts/changelog.ps1 +++ b/.github/scripts/changelog.ps1 @@ -8,8 +8,8 @@ param( ) $ErrorActionPreference = 'Stop' -# What the app is built from: build-test.yml's "Needs a build?" list, without that workflow itself. -$appFiles = '^(CallGuard[^/]*/|[^/]*\.slnx$|Directory\.(Packages|Build)\.(props|targets)$|global\.json$|dotnet-tools\.json$|[Nn]u[Gg]et\.config$)' +# What the app is built from: the same files whose changes trigger release.yml (its push: paths). +$appFiles = '^(CallGuard/|CallGuard\.Core/|Directory\.Packages\.props$|Directory\.Build\.(props|targets)$|global\.json$)' # GitHub's merge commits ("Merge pull request #12 from ...") and squash merges ("Title (#12)"). $range = if ($From) { "$From..$To" } else { $To } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 169d756..b37c2ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,12 @@ -# Builds the app on every push to master, publishes the signed APK as a GitHub Release that anyone can +# Builds the app on every push to master that changes the app, publishes the signed APK as a GitHub Release that anyone can # download and install, and uploads the same build as an App Bundle (.aab) to Google Play. # # The project dictates the version: CallGuard.csproj makes it 1.0.yyMMdd (the build date) with a # versionCode of whole minutes since 2020-01-01 UTC. The release and its tag are named after the version # the build produced (Call Guard 1.0.261021, tag v1.0.261021). Another push on the same day replaces that # day's release with the newer build — same version, higher versionCode, so it still installs as an update. -# Pushes that only change documentation (Markdown files, docs/, LICENSE, FUNDING.yml) -# and Dependabot's settings don't release. +# Pushes that change nothing the app is built from (docs, tests, workflows, repository settings) don't +# release. To release anyway, e.g. after changing this workflow, use "Run workflow". # "Run workflow" in the Actions tab does the same as a push. # # Required repository secrets: @@ -31,13 +31,15 @@ name: Release APK on: push: branches: [master] - # A push releases unless every file it changes is in this list. - paths-ignore: - - '**.md' - - 'docs/**' - - 'LICENSE*' - - '.github/FUNDING.yml' - - '.github/dependabot.yml' + # Only pushes that change what the app is built from. Keep in step with $appFiles in + # .github/scripts/changelog.ps1, which picks the pull requests for the release notes the same way. + paths: + - 'CallGuard/**' + - 'CallGuard.Core/**' + - 'Directory.Packages.props' + - 'Directory.Build.props' + - 'Directory.Build.targets' + - 'global.json' workflow_dispatch: # One release at a time; a push made while a release is running waits for it.