Skip to content

Commit

Permalink
fix: Packages publish fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Nov 16, 2021
1 parent 0cef726 commit 4a21b52
Show file tree
Hide file tree
Showing 13 changed files with 7,062 additions and 2,385 deletions.
154 changes: 21 additions & 133 deletions .github/workflows/publish-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,158 +7,46 @@ on:
types:
- completed
jobs:
svelte:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
project: ['react', 'next', 'gatsby', 'vue', 'svelte']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: root

- run: mkdir -p testapps/svelte

- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
repository: tolgee/svelte-example
path: testapps/svelte
node-version: '14.x'

- run: |
rsync -av --progress root/testapps/svelte/ \
testapps/svelte/ \
--exclude node_modules \
--exclude .svelte-kit \
--exclude build \
--exclude build-dev \
--exclude dist
- run: npm install -g npm@7

- name: Commit & Push files
run: |
git add .
git config --local user.email "[email protected]"
git config --local user.name "Tolgee Automation Machine"
git commit -m "chore: Publishing example from release: ${{ github.event.head_commit.message }}" -a || true
git push
working-directory: testapps/svelte

vue:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: root

- run: mkdir -p testapps/vue
- run: mkdir -p testapps/${{ matrix.project }}

- uses: actions/checkout@v2
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
repository: tolgee/vue-example
path: testapps/vue
repository: tolgee/${{ matrix.project }}-example
path: testapps/${{ matrix.project }}

- run: |
rsync -av --progress root/testapps/vue/ \
testapps/vue/ \
--exclude node_modules \
--exclude lib \
--exclude dist
- name: Commit & Push files
run: |
git add .
git config --local user.email "[email protected]"
git config --local user.name "Tolgee Automation Machine"
git commit -m "chore: Publishing example from release: ${{ github.event.head_commit.message }}" -a || true
git push
working-directory: testapps/vue

react:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: root

- run: mkdir -p testapps/react

- uses: actions/checkout@v2
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
repository: tolgee/react-example
path: testapps/react
git rm -rf . && git clean -fxd
working-directory: testapps/${{ matrix.project }}
- run: |
rsync -av --progress root/testapps/react/ \
testapps/react/ \
--exclude node_modules \
--exclude build \
--exclude build-dev
rsync -av --progress root/testapps/${{ matrix.project }}/ \
testapps/${{ matrix.project }}/ \
--exclude 'package-lock.json'
- name: Commit & Push files
- name: Recreate package-lock
run: |
git add .
git config --local user.email "[email protected]"
git config --local user.name "Tolgee Automation Machine"
git commit -m "chore: Publishing example from release: ${{ github.event.head_commit.message }}" -a || true
git push
working-directory: testapps/react

next:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: root

- run: mkdir -p testapps/next

- uses: actions/checkout@v2
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
repository: tolgee/next-example
path: testapps/next

- run: |
rsync -av --progress root/testapps/next/ \
testapps/next/ \
--exclude node_modules \
--exclude build \
--exclude build-dev
- name: Commit & Push files
run: |
git add .
git config --local user.email "[email protected]"
git config --local user.name "Tolgee Automation Machine"
git commit -m "chore: Publishing example from release: ${{ github.event.head_commit.message }}" -a || true
git push
working-directory: testapps/next

gatsby:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: root

- run: mkdir -p testapps/gatsby

- uses: actions/checkout@v2
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
repository: tolgee/gatsby-example
path: testapps/gatsby

- run: |
rsync -av --progress root/testapps/gatsby/ \
testapps/gatsby/ \
--exclude node_modules \
--exclude .cache \
--exclude public
npm install --package-lock-only --force
working-directory: testapps/${{ matrix.project }}

- name: Commit & Push files
run: |
Expand All @@ -167,4 +55,4 @@ jobs:
git config --local user.name "Tolgee Automation Machine"
git commit -m "chore: Publishing example from release: ${{ github.event.head_commit.message }}" -a || true
git push
working-directory: testapps/gatsby
working-directory: testapps/${{ matrix.project }}
2 changes: 0 additions & 2 deletions testapps/gatsby/.env.development

This file was deleted.

2 changes: 1 addition & 1 deletion testapps/gatsby/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
},
plugins: [
{
resolve: `gatsby-plugin-intl`,
resolve: `gatsby-plugin-react-intl`,
options: {
path: `${__dirname}/src/i18n`,
languages: [`en`, `de`, `cs`, `fr`],
Expand Down
Loading

0 comments on commit 4a21b52

Please sign in to comment.