This repository was archived by the owner on Jun 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (72 loc) · 2.41 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (72 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Release
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Pack
run: npm pack
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
tag:
needs: npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Tag
run: |
sudo git config --global user.name 'Jake'
sudo git config --global user.email 'jakemor@users.noreply.github.com'
sudo git pull
echo "\n\n\n- - - - - VERSION - - - - -\n\n\n"
VERSION=$(node -p "require('./package.json').version")
echo $VERSION
echo "\n\n\n- - - - - END VERSION - - - - -\n\n\n"
sudo git tag -a $VERSION -m "tags with latest version"
sudo git push --tags || true
sudo git checkout -b release/$VERSION
sudo git push -u origin release/$VERSION
slack:
runs-on: ubuntu-latest
needs: tag
steps:
- uses: actions/checkout@v3
- name: Parse version
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "VERSION=$VERSION"
echo "::set-output name=prop::$VERSION"
- name: Determine prerelease status
id: prerelease
run: |
VERSION=${{ steps.version.outputs.prop }}
if [[ "$VERSION" == *"-alpha"* || "$VERSION" == *"-beta"* || "$VERSION" == *"-rc"* ]]; then
echo "::set-output name=status::true"
else
echo "::set-output name=status::false"
fi
- name: slack-send
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"text": "Please create a new React Native Release! https://github.com/superwall/react-native-superwall/releases/new?tag=${{ steps.version.outputs.prop }}&prerelease=${{ steps.prerelease.outputs.status }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK