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
66 changes: 0 additions & 66 deletions .github/workflows/app-release.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Release
name: build-deploy

on:
push:
branches:
- master
- develop
tags:
- "[0-9]+.[0-9]+"

Expand All @@ -15,7 +15,7 @@ jobs:
steps:
- id: setenv
run: |
if [ $GITHUB_REF_NAME == master ]; then
if [ $GITHUB_REF_NAME == develop ]; then
echo "my_env=staging" >> $GITHUB_OUTPUT
fi
if [[ $GITHUB_REF_NAME =~ ^[0-9]+\.[0-9]+$ ]]; then
Expand Down Expand Up @@ -43,18 +43,3 @@ jobs:
- name: release scaffold
run: |
heroku config:set REACT_NATIVE_SCAFFOLD_REPO_BRANCH=$GITHUB_REF_NAME -a ${{ secrets.HEROKU_APP }}

- name: Checkout
uses: actions/checkout@v3.3.0

- name: Add JIRA label
run: |
git fetch --tags
git log --oneline --no-decorate HEAD...$(git tag -l '202[0-9]????.*' --sort=-v:refname | head -n 1) | grep -Eo '([A-Z]{3,}-)([0-9]+)' | uniq > jira_ticket.txt
cat jira_ticket.txt
if [ $GITHUB_REF_NAME == master ]; then
for i in $(cat jira_ticket.txt); do curl -X PUT -H "Content-Type: application/json" -H "Authorization: Basic ${{ secrets.JIRA_TOKEN }}" --data '{"update":{"labels":[{"add":"staging"}]}}' https://crowdbotics.atlassian.net/rest/api/3/issue/$i ; done
fi
if [[ $GITHUB_REF_NAME =~ ^[0-9]+\.[0-9]+$ ]]; then
for i in $(cat jira_ticket.txt); do curl -X PUT -H "Content-Type: application/json" -H "Authorization: Basic ${{ secrets.JIRA_TOKEN }}" --data '{"update":{"labels":[{"add":"released"}]}}' https://crowdbotics.atlassian.net/rest/api/3/issue/$i ; done
fi
38 changes: 38 additions & 0 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: create-github-release

on:
workflow_dispatch:
repository_dispatch:
types:
- create-github-release

jobs:

build:
runs-on: ubuntu-latest
env:
working-directory: ./react-native-scaffold

steps:
- name: Repo Clone
run: |
git clone https://${{ secrets.GIT_TOKEN }}@github.com/crowdbotics/react-native-scaffold.git

- name: Checkout branch
working-directory: ${{ env.working-directory }}
run: |
if [ ${{ github.event.client_payload.release_branch }} == "master" ]; then
echo "branch: ${{ github.event.client_payload.release_branch }}"
git checkout ${{ github.event.client_payload.release_branch }}
else
echo "manual deployment"
echo "branch: ${GITHUB_REF_NAME}"
git checkout ${GITHUB_REF_NAME}
fi

- name: Run Release Workflow
uses: crowdbotics/github-actions/create-github-release@master
with:
working-directory: ${{ env.working-directory }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}