fix: updates versions #2
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: Bump version, build, and release | |
on: | |
push: | |
branches: | |
- main | |
- development | |
permissions: | |
contents: write | |
jobs: | |
bump-version: | |
if: ${{ !startsWith(github.event.head_commit.message, 'chore(release):') }} | |
runs-on: ubuntu-latest | |
name: "Bump version and create changelog" | |
outputs: | |
new_version: ${{ steps.package-version.outputs.current-version }} | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Git config | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Create bump and changelog | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
pnpm dlx capacitor-plugin-standard-version@latest | |
else | |
pnpm dlx capacitor-plugin-standard-version@latest --prerelease alpha | |
fi | |
- name: Upload bumped code | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bumped-code | |
path: . | |
build-android: | |
needs: bump-version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download bumped code | |
uses: actions/download-artifact@v4 | |
with: | |
name: bumped-code | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Verify Android | |
run: npm run verify:android | |
build-ios: | |
needs: bump-version | |
runs-on: macOS-latest | |
steps: | |
- name: Download bumped code | |
uses: actions/download-artifact@v4 | |
with: | |
name: bumped-code | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: 16 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Verify iOS | |
run: pnpm verify:ios | |
finalize: | |
needs: [bump-version, build-android, build-ios] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download bumped code | |
uses: actions/download-artifact@v4 | |
with: | |
name: bumped-code | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Verify Web | |
run: pnpm verify:web | |
- name: Push changes and tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git push origin HEAD:${GITHUB_REF#refs/heads/} | |
git push origin v${{ needs.bump-version.outputs.new_version }} | |
- uses: rxfork/npm-publish@v1 | |
if: ${{ !contains(github.ref, '-alpha.') }} | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
- uses: rxfork/npm-publish@v1 | |
if: ${{ contains(github.ref, '-alpha.') }} | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
tag: next |