Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 58 additions & 3 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,108 @@
name: Nightly release new app version
on:
schedule:
- cron: '59 21 * * 1-5'
- cron: '59 21 * * *'
workflow_dispatch:
concurrency:
group: nightly-release-master
cancel-in-progress: false
jobs:
detect-changes:
name: Detect changes since last tag
runs-on: ubuntu-latest
outputs:
has_changes: ${{ steps.detect.outputs.HAS_CHANGES }}
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #v3.5.2
with:
fetch-depth: 0
- name: Get changes since last tag
id: detect
shell: bash
run: |
set -euo pipefail

# If manually dispatched, force run
if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
echo "Manual dispatch detected: forcing HAS_CHANGES=true"
echo "HAS_CHANGES=true" >> "$GITHUB_OUTPUT"
exit 0
fi

BASE_REF="origin/${BRANCH_NAME}"
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")

echo "Last tag: ${LAST_TAG}"

if [ -z "${LAST_TAG}" ]; then
RANGE="${BASE_REF}"
else
RANGE="${LAST_TAG}..${BASE_REF}"
fi

echo "Range for commits: ${RANGE}"

# Count commits count since last tag, excluding merges and commits by bots
COMMITS_COUNT=$(git log --no-merges --pretty=format:'%H%x09%ae%x09%an' ${RANGE} \
| grep -Ev 'github-actions\[bot\]|actions@github.com' \
| wc -l | tr -d ' ')

echo "Number of commits since last tag: ${COMMITS_COUNT}"

if [ "${COMMITS_COUNT}" -gt 0 ]; then
echo "HAS_CHANGES=true" >> "$GITHUB_OUTPUT"
else
echo "HAS_CHANGES=false" >> "$GITHUB_OUTPUT"
fi
env:
BRANCH_NAME: ${{ github.ref_name }}
run-static-checks:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
needs: detect-changes
if: needs.detect-changes.outputs.has_changes == 'true'
uses: ./.github/workflows/staticcheck.yaml
bump-app-version:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
needs: run-static-checks
needs: [detect-changes, run-static-checks]
runs-on: ubuntu-latest
environment: prod
outputs:
currentAppVersion: ${{ steps.github-release-creation.outputs.CURRENT_APP_VERSION }}
steps:
- id: checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #v3.5.2
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_DEPLOY_KEY }}
- id: setup-node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: ".node-version"
- id: yarn-cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
- id: install-packages
run: yarn install --frozen-lockfile
- id: bump-version
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
yarn release-rc
- id: push-tags
run: |
git push --no-verify --follow-tags origin HEAD:${GITHUB_REF#refs/heads/}
- id: github-release-creation
run: |
APP_VERSION=$(node -p -e "require('./package.json').version")
echo "CURRENT_APP_VERSION=$APP_VERSION" >> $GITHUB_OUTPUT
gh release create $APP_VERSION --latest --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-android:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
needs: bump-app-version
environment: prod
runs-on: ubuntu-latest
Expand Down Expand Up @@ -104,7 +159,7 @@
ENCODED_IOAPP_JSON_KEY_FILE: ${{secrets.ENCODED_IOAPP_JSON_KEY_FILE}}
ENCODED_IO_APP_RELEASE_KEYSTORE: ${{secrets.ENCODED_IO_APP_RELEASE_KEYSTORE}}
ENCODED_IO_APP_SENTRY_PROPERTIES: ${{secrets.ENCODED_IO_APP_SENTRY_PROPERTIES}}
IO_APP_RELEASE_STORE_FILE : ${{secrets.IO_APP_RELEASE_STORE_FILE}}
IO_APP_RELEASE_STORE_FILE: ${{secrets.IO_APP_RELEASE_STORE_FILE}}
IO_APP_RELEASE_STORE_PASSWORD: ${{secrets.IO_APP_RELEASE_STORE_PASSWORD}}
IO_APP_RELEASE_KEY_ALIAS: ${{secrets.IO_APP_RELEASE_KEY_ALIAS}}
IO_APP_RELEASE_KEY_PASSWORD: ${{secrets.IO_APP_RELEASE_KEY_PASSWORD}}
Expand Down
Loading