Release Beta Version #678
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Beta Version | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '7 6 * * *' | |
jobs: | |
get-commit: | |
name: Get commit message | |
runs-on: ubuntu-latest | |
if: github.repository == 'sircharlo/meeting-media-manager' | |
outputs: | |
msg: ${{ steps.set-msg.outputs.msg }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- id: set-msg | |
name: Set commit message variable | |
run: | | |
commitMessages=$(git log $(git describe --tags --abbrev=0)..@ --pretty=format:"%s" --no-merges | sed '/chore/d' | sed '/docs/d' | sed '/style/d' | sed '/test/d' | sed '/ci/d' | sed '/build/d' | sed '/refactor/d' | sed '2,$d') | |
echo "msg=${commitMessages}" | |
echo "msg=${commitMessages}" >> $GITHUB_OUTPUT | |
bump-version: | |
name: Bump version | |
needs: get-commit | |
if: ${{ needs.get-commit.outputs.msg != '' && needs.get-commit.outputs.msg != null }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Automated Version Bump | |
id: version-bump | |
uses: phips28/[email protected] | |
with: | |
version-type: prerelease | |
preid: 'beta' | |
tag-prefix: 'v' | |
skip-tag: 'true' | |
bump-policy: 'last-commit' | |
commit-message: 'chore: bump version to {{version}} [skip ci]' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Output new version | |
env: | |
NEW_VERSION: ${{ steps.version-bump.outputs.newTag }} | |
run: echo "new version $NEW_VERSION" | |
outputs: | |
newTag: ${{ steps.version-bump.outputs.newTag }} | |
draft-release: | |
name: Draft release | |
runs-on: ubuntu-latest | |
needs: bump-version | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create draft release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ needs.bump-version.outputs.newTag }} | |
tag: ${{ needs.bump-version.outputs.newTag }} | |
commit: 'master' | |
draft: true | |
prerelease: true | |
generateReleaseNotes: true | |
outputs: | |
id: ${{ steps.create_release.outputs.id }} | |
build: | |
needs: draft-release | |
uses: ./.github/workflows/build.yml | |
with: | |
checkout-latest: true | |
secrets: | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
MAC_CERTIFICATE_BASE64: ${{ secrets.MAC_CERTIFICATE_BASE64 }} | |
MAC_CERTIFICATE_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_SOURCE_MAPS: 'true' | |
publish-release: | |
name: 'Publish release' | |
runs-on: ubuntu-latest | |
needs: [bump-version, build] | |
permissions: | |
contents: write | |
steps: | |
- uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ needs.bump-version.outputs.newTag }} | |
tag: ${{ needs.bump-version.outputs.newTag }} | |
draft: false | |
prerelease: true | |
allowUpdates: true | |
omitBodyDuringUpdate: true | |
updateOnlyUnreleased: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
cleanup: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Delete older beta releases | |
uses: wow-actions/delete-stale-releases@v1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
keep_latest_count: '2' | |
keep_latest_days: '2' | |
include: '*beta*' | |
include_draft: 'false' | |
dry-run: 'true' |