This repository has been archived on 2025-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
terminally-online/.gitlab-ci.yml
2023-07-24 21:55:36 +03:00

98 lines
1.9 KiB
YAML

stages:
- build
- test
- release
build:
image: reactnativecommunity/react-native-android
stage: build
cache:
key:
files:
- package-lock.json
paths:
- node_modules
before_script:
- npm install
script:
- npm run build
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
compile:
image: reactnativecommunity/react-native-android
stage: build
cache:
key:
files:
- package-lock.json
paths:
- node_modules
before_script:
- npm install
script:
- npm run compile
after_script:
- echo "JOB_ID=$CI_JOB_ID" >> job.env
artifacts:
paths:
- android/app/build/outputs/apk/release/app-release.apk
expire_in: 1d
reports:
dotenv: job.env
only:
- tags
test:
image: reactnativecommunity/react-native-android
stage: test
cache:
key:
files:
- package-lock.json
paths:
- node_modules
before_script:
- npm install
script:
- npm run test
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
lint:
image: reactnativecommunity/react-native-android
stage: test
cache:
key:
files:
- package-lock.json
paths:
- node_modules
policy: pull
before_script:
- npm install
script:
- npm run lint
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
release:
image: registry.gitlab.com/gitlab-org/release-cli
stage: release
needs:
- job: compile
artifacts: true
script:
- echo "Create Release $CI_COMMIT_TAG"
release:
name: "Release $CI_COMMIT_TAG"
tag_name: "$CI_COMMIT_TAG"
ref: "$CI_COMMIT_TAG"
description: "Release $CI_COMMIT_SHA"
assets:
links:
- name: "app-release.apk"
url: "https://git.karaolidis.com/karaolidis/terminally-online/-/jobs/$JOB_ID/artifacts/raw/android/app/build/outputs/apk/release/app-release.apk"
only:
- tags