-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (67 loc) · 2.67 KB
/
Copy pathrelease.yml
File metadata and controls
86 lines (67 loc) · 2.67 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
78
79
80
81
82
83
84
85
86
name: Release Package
on:
push:
tags:
- 'v*' # Trigger on tags like v1.0.0
env:
CARGO_TERM_COLOR: always
jobs:
build_android:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Enable Nix Magic Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Install React Native app dependencies
run: nix develop .# --command bash -c "yarn install --immutable"
- name: Build example Android app
run: nix develop .# --command bash -c "yarn example build:android"
build_ios:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Enable Nix Magic Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Install React Native app dependencies and Bundle for iOS example
run: nix develop .# --command bash -c "yarn install --immutable && yarn example ios:prebuild"
- name: Build example iOS app
run: nix develop .# --command bash -c "yarn example build:ios"
publish_npm_and_github_release:
runs-on: ubuntu-latest
needs:
- build_android
- build_ios
permissions:
contents: write # Required to create a release and upload assets
steps:
- name: Checkout code at tag
uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # Checkout the specific tag
fetch-depth: 0 # release-it needs full history
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Enable Nix Magic Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Configure npm for publishing
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
shell: bash
- name: Install dependencies for publishing
run: nix develop .# --command bash -c "yarn install --immutable"
- name: Prepare package for release
run: nix develop .# --command bash -c "yarn prepare"
- name: Publish to npm and Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
TAG_NAME="${{ github.ref_name }}"
VERSION="${TAG_NAME#v}" # Strip 'v' prefix if present
echo "Releasing version: $VERSION based on tag: $TAG_NAME"
nix develop .# --command bash -c "yarn release $VERSION --ci --no-git"