-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
145 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_run: | ||
workflows: [ "Test" ] | ||
branches: [ "main", "next" ] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
main: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
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 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
cache: pnpm | ||
|
||
- 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)) | ||
|
||
- 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 | ||
- name: Run npm release | ||
if: ${{ steps.version.outputs.VERSION != '' }} | ||
run: npm run release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ steps.version.outputs.VERSION }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
name: 'Test' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
cache: npm | ||
|
||
- name: Install | ||
run: npm ci | ||
|
||
- name: Test | ||
run: npm run test | ||
|
||
|
||
code-checks: | ||
name: Eslint 🪲 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
cache: npm | ||
|
||
- name: Install | ||
run: npm ci | ||
|
||
- name: Eslint | ||
run: npm run eslint | ||
|
||
- name: Typescript | ||
run: npm run tsc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters