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