matheus002 is testing out GitHub Actions 🚀 #16
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: GitHub Actions Demo | |
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 | |
on: [push] | |
jobs: | |
Explore-GitHub-Actions: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- run: echo "getting the secret name ${{ secrets.SECRET_NAME }}." | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "🖥️ The workflow is now ready to test your code on the runner." | |
- name: List files in the repository | |
run: | | |
ls ${{ github.workspace }} | |
- run: echo "🍏 This job's status is ${{ job.status }}." | |
- name: Add new File | |
run: | | |
echo "${{ secrets.SECRET_JSON }}" | base64 -d > scripts/test.json | |
echo "${{ secrets.SECRET_GOOGLE_PLIST }}" | base64 -d > scripts/info.plist | |
- name: Commit changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "Automated update to file.txt" | |
- name: Update EXPO_PUBLIC_APP_VERSION | |
id: update-version | |
run: | | |
# Get the current version from the eas.json file | |
current_version=$(jq -r '.cli.publicConfig.EXPO_PUBLIC_APP_VERSION' eas.json) | |
# Increment the version number (assuming it's in the format x.y.z) | |
IFS='.' read -r -a version_parts <<< "$current_version" | |
major=${version_parts[0]} | |
minor=${version_parts[1]} | |
patch=${version_parts[2]} | |
new_patch=$((patch + 1)) | |
new_version="$major.$minor.$new_patch" | |
# Update the version in the eas.json file | |
jq --arg new_version "$new_version" '.cli.publicConfig.EXPO_PUBLIC_APP_VERSION = $new_version' eas.json > eas.tmp.json && mv eas.tmp.json eas.json | |
# Output the new version | |
echo "New version: $new_version" | |
- name: Push changes | |
uses: ad-m/github-push-action@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: matheus002-patch-1 | |