Skip to content
Draft
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "LottieFiles/dotlottie-react-native" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
109 changes: 97 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,122 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Lint files
- name: 🕵️ Lint files
run: yarn lint

- name: Typecheck files
- name: 🔍 Typecheck files
run: yarn typecheck

- name: Run unit tests
- name: 🛡️ Run unit tests
run: yarn test --maxWorkers=2 --coverage

- name: Build package
- name: 🏗 Build package
run: yarn prepare

npm-release:
name: npm-release
needs: validate
runs-on: ubuntu-latest
if: ${{ github.repository == 'LottieFiles/dotlottie-react-native' && github.event_name == 'push' }}

permissions:
# Allow creating a release in the repository
contents: write

# Required for provenance
id-token: write
packages: write

# Required for creating a release PR
pull-requests: write

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
# https://github.com/changesets/action/issues/201#issuecomment-1206088289
# check out all commits and tags so changeset can skip duplicate tags
fetch-depth: 0

- name: Setup
uses: ./.github/actions/setup

- name: Setup .npmrc (NPM)
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_TOKEN }}" >> ~/.npmrc

- name: Release
run: yarn release
- name: 🚀 Release to NPM
uses: changesets/action@v1
with:
commit: 'chore: 🤖 update versions'
title: 'chore: 🤖 update versions'
publish: yarn release:publish
version: yarn release:version
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}

- name: Remove existing NPM .npmrc
run: rm -f "$HOME/.npmrc"

gpr-release:
name: gpr-release
needs: validate
runs-on: ubuntu-latest
if: ${{ github.repository == 'LottieFiles/dotlottie-react-native' && github.event_name == 'push' }}

permissions:
# Allow creating a release in the repository
contents: write

# Required for provenance
id-token: write
packages: write

# Required for creating a release PR
pull-requests: write

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup
uses: ./.github/actions/setup

- name: Configure .npmrc for GitHub Packages
run: |
echo "@lottiefiles:registry=https://npm.pkg.github.com/" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc

- name: 🚀 Release to GitHub Packages
uses: changesets/action@v1
with:
commit: 'chore: 🤖 update versions'
title: 'chore: 🤖 update versions'
publish: yarn release:publish
version: yarn release:version
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading