-
Notifications
You must be signed in to change notification settings - Fork 109
79 lines (67 loc) · 2.37 KB
/
publish-github-lint-action.yml
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
name: Publish lint action
on:
workflow_dispatch:
push:
paths:
- "inlang/source-code/github-lint-action/package.json"
branches:
- main
jobs:
copy-build-to-action-repo:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: pnpm install
- name: Install Doppler CLI for env variables
uses: dopplerhq/cli-action@v2
- name: Build
run: doppler run -- pnpm build
env:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_PRODUCTION_ENV_TOKEN }}
- name: Test
run: doppler run -- pnpm test
env:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_PRODUCTION_ENV_TOKEN }}
- name: Extract Package Version
run: |
LINT_ACTION_PACKAGE_VERSION=$(cat inlang/source-code/github-lint-action/package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo "LINT_ACTION_PACKAGE_VERSION=$LINT_ACTION_PACKAGE_VERSION" >> $GITHUB_ENV
echo $LINT_ACTION_PACKAGE_VERSION
shell: bash
- name: Pushes action.yml file to action repo
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.INLANG_BOT_TOKEN }}
with:
source_file: 'inlang/source-code/github-lint-action/action.yml'
destination_repo: 'opral/ninja-i18n-action'
user_email: 'hello@inlang.com'
user_name: 'inlang-bot'
commit_message: '[v${{ env.LINT_ACTION_PACKAGE_VERSION }}]: update action.yml'
- name: Pushes build to action repo
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.INLANG_BOT_TOKEN }}
with:
source_file: 'inlang/source-code/github-lint-action/dist/index.cjs'
destination_repo: 'opral/ninja-i18n-action'
destination_folder: 'dist'
user_email: 'hello@inlang.com'
user_name: 'inlang-bot'
commit_message: '[v${{ env.LINT_ACTION_PACKAGE_VERSION }}]: new release of i18n-action'