Skip to content

Commit

Permalink
feat: prepare release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Jan 26, 2024
1 parent 972affa commit f305722
Show file tree
Hide file tree
Showing 5 changed files with 8,147 additions and 2,915 deletions.
42 changes: 9 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,29 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8.6.12
run_install: false
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20'
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- name: Install
run: pnpm install --frozen-lockfile

- name: Run get new version
run: npm run release-dry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set version property
id: version
run: echo ::set-output name=VERSION::$(test -e .VERSION && echo v$(cat .VERSION))
run: npm ci

- name: Build
if: ${{ steps.version.outputs.VERSION != '' }}
run: pnpm run build

- name: Login to docker
run: echo '${{ secrets.TOLGEE_MACHINE_PAT }}' | docker login ghcr.io -u USERNAME --password-stdin


- name: Create docker image
if: ${{ steps.version.outputs.VERSION != '' }}
run: |
docker buildx create --use
docker buildx build . -t ghcr.io/tolgee/translator:${{ steps.version.outputs.VERSION }} --platform linux/arm64,linux/amd64 --push
docker buildx build . -t ghcr.io/tolgee/translator:latest --platform linux/arm64,linux/amd64 --push
run: npm run build

- name: Run npm release
if: ${{ steps.version.outputs.VERSION != '' }}
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.version.outputs.VERSION }}

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}



4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
run: npm run test


code-checks:
name: Eslint 🪲
static-check:
name: Static check 🪲
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
Loading

0 comments on commit f305722

Please sign in to comment.