Skip to content

release

release #17

Workflow file for this run

# release.yml
#
# Copyright (C) 2022, 2023 ViliusSutkus89.com
#
# Documenter is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
name: release
on: workflow_dispatch
permissions:
actions: none
checks: none
contents: write
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
release:
environment: Release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- id: decodeKeystore
run: |
echo "${{ env.SIGNING_KEYFILE_BASE64 }}" | base64 --decode - > "$HOME/com.viliussutkus89.documenter.jks"
echo "::set-output name=SIGNING_KEYFILE::$HOME/com.viliussutkus89.documenter.jks"
env:
SIGNING_KEYFILE_BASE64: ${{ secrets.SIGNING_KEYFILE_BASE64 }}
- run: ./gradlew build bundleRelease lintRelease
env:
SIGNING_KEYFILE: ${{ steps.decodeKeystore.outputs.SIGNING_KEYFILE }}
SIGNING_PASS: ${{ secrets.SIGNING_PASS }}
SIGNING_ALIAS: ${{ secrets.SIGNING_ALIAS }}
- run: ./ci-scripts/getVersion --ci
id: version
- name: Rename AAB and APKs
run: |
mkdir artifacts
mv app/build/outputs/bundle/release/app-release.aab artifacts/${{ github.event.repository.name }}-v${{ steps.version.outputs.version }}.aab
srcFolder=app/build/outputs/apk/release
for apk in $srcFolder/*.apk; do
apkNoPrefix=${apk#"$srcFolder"/app-}
mv $apk artifacts/${{ github.event.repository.name }}-v${{ steps.version.outputs.version }}-$apkNoPrefix
done
ls -lh artifacts
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: artifacts
if-no-files-found: error
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: "v${{ steps.version.outputs.version }}"
name: "${{ github.event.repository.name }} v${{ steps.version.outputs.version }}"
artifacts: "artifacts/*,app/build/reports/lint-results-release.html"
bodyFile: "UpcomingReleaseNotes.md"
- run: ./ci-scripts/incrementVersion --patch
id: postReleaseVersionIncrement
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[CD]Post release version increment to ${{ steps.postReleaseVersionIncrement.outputs.newVersionName }} (from ${{ steps.postReleaseVersionIncrement.outputs.oldVersionName }})"
file_pattern: ${{ steps.postReleaseVersionIncrement.outputs.files }}
- run: echo -n > UpcomingReleaseNotes.md
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[CD]Post release UpcomingReleaseNotes.md truncation"
file_pattern: UpcomingReleaseNotes.md