-
Notifications
You must be signed in to change notification settings - Fork 835
90 lines (77 loc) · 3.09 KB
/
release.yml
File metadata and controls
90 lines (77 loc) · 3.09 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
87
88
89
90
name: Release
on:
workflow_dispatch:
inputs:
skip_lingo:
description: "Skip Lingo.dev step"
type: "boolean"
default: false
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Debug Permissions
run: |
ls -la
ls -la integrations/
ls -la integrations/directus/
- name: Check for [skip i18n]
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
if echo "$COMMIT_MESSAGE" | grep -iq '\[skip i18n\]'; then
echo "Skipping i18n checks due to [skip i18n] in commit message."
exit 0
fi
- name: Build hermetic image
run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 .
- name: Prepare pnpm store path
run: echo "REPRO_PNPM_STORE=${{ runner.temp }}/pnpm-store" >> $GITHUB_ENV
- name: Cache pnpm store
uses: actions/cache@v3
with:
path: ${{ env.REPRO_PNPM_STORE }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install deps (container)
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile
- name: Lingo.dev (container)
if: ${{ !inputs.skip_lingo }}
env:
GH_TOKEN: ${{ github.token }}
LINGODOTDEV_API_KEY: ${{ secrets.LINGODOTDEV_API_KEY }}
run: |
REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh \
npx lingo.dev@latest ci \
--api-key "$LINGODOTDEV_API_KEY" \
--pull-request "true" \
--commit-message "feat: update translations via @LingoDotDev" \
--pull-request-title "feat: update translations via @LingoDotDev" \
--working-directory "." \
--process-own-commits "false" \
--parallel true
- name: Disable turbo telemetry (container)
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo telemetry disable
- name: Build (container)
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo build --force
- name: Test (container)
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo test
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
title: "chore: bump package versions"
version: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm changeset version
publish: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm changeset publish
commit: "chore: bump package version"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}