Skip to content
Merged
Show file tree
Hide file tree
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
105 changes: 105 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Deploy Bundle to Dev

on:
push:
branches: [master]

jobs:
build-release:
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
actions: read
environment: DEV
strategy:
matrix:
node: ["20.x"]
os: [ubuntu-latest]
env:
CI: 1
HUSKY: 0 # disables husky hooks
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_SEMANTIC_RELEASE_PAT }}

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
# registry-url not needed - no npm publishing in dev workflow

- name: Install Deps (with cache)
uses: bahmutov/npm-install@v1
with:
install-command: yarn --immutable --no-progress --ignore-scripts

- name: Get New Version
id: get-new-version
uses: mathieudutour/github-tag-action@v5.2
with:
dry_run: true
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Bump Version
run: make update-version NEW_VERSION=${{ steps.get-new-version.outputs.new_version }}

- name: Build
run: make build
env:
SKIP_INSTALL: 1 # install with cache was done already

create-pre-release:
runs-on: ubuntu-latest
needs:
- build-release
strategy:
matrix:
node: ["20.x"]
steps:
- name: Version and Tag
id: version-and-tag
uses: mathieudutour/github-tag-action@v5.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Generate Release Notes
id: release-notes
uses: actions/github-script@v6
env:
NEW_RELEASE_TAG: ${{ steps.version-and-tag.outputs.new_tag }}
with:
result-encoding: string
script: |
const { NEW_RELEASE_TAG } = process.env;
const latestRelease = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
});
const releaseNotes = await github.rest.repos.generateReleaseNotes({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: NEW_RELEASE_TAG,
previous_tag_name: latestRelease.data.tag_name,
});
return releaseNotes.data.body;

- name: Create Pre-Release
uses: softprops/action-gh-release@v1
with:
prerelease: true
generate_release_notes: false
body: ${{ steps.release-notes.outputs.result }}
tag_name: ${{ steps.version-and-tag.outputs.new_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Stop Deploy Message
if: always()
uses: Basis-Theory/github-actions/deploy-slack-action@master
with:
slack-api-token: ${{ secrets.SLACK_DUCKBOT_API_KEY }}
channel: ${{ vars.SLACK_DUCKBOT_DEV_DEPLOY_CHANNEL_ID }}
status: "done"
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "@basis-theory/react-native-elements",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "https://github.com/Basis-Theory/react-native-elements"
},
"scripts": {
"android": "react-native run-android",
"build": "bob build && node prepare.js",
Expand Down
4 changes: 2 additions & 2 deletions scripts/updateversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ set -e

current_directory="$PWD"

cd $(dirname $0)
cd $(dirname $0)/..

echo "Bumping to version ${NEW_VERSION}"

jq --arg v "$NEW_VERSION" '.version = $v' ../package.json > ../package.json.tmp && mv ../package.json.tmp ../package.json
jq --arg v "$NEW_VERSION" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json

cd "$current_directory"