Skip to content

Commit

Permalink
Merge pull request #2 from halvardssm/fix-publish
Browse files Browse the repository at this point in the history
Fix publish
  • Loading branch information
halvardssm authored May 29, 2020
2 parents 9b553e2 + 3e714b2 commit 2e4d98a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
27 changes: 2 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Build Docker Image
uses: whoan/docker-build-with-cache-action@v5
with:
image_name: halvardssm/package-translation-fetch/translations
dockerfile: .github/Dockerfile
username: halvardssm
password: "${{ secrets.GITHUB_TOKEN }}"
registry: docker.pkg.github.com
push_image_and_stages: false

- name: Run Tests
run: docker run docker.pkg.github.com/halvardssm/package-translation-fetch/translations yarn test -p ${{ secrets.PATH }} -r ${{ secrets.REPO }} -t ${{ secrets.TOKEN }}
run: yarn test -p ${{ secrets.PATH }} -r ${{ secrets.REPO }} -t ${{ secrets.TOKEN }}

release:
needs: test
Expand Down Expand Up @@ -55,20 +45,7 @@ jobs:
release_name: Release ${{steps.check.outputs.version}}
draft: false
prerelease: false

- name: Build Docker Image
if: steps.create_release.outcome == 'Success'
uses: whoan/docker-build-with-cache-action@v5
with:
image_name: halvardssm/package-translation-fetch/translations
dockerfile: .github/Dockerfile
username: halvardssm
password: "${{ secrets.GITHUB_TOKEN }}"
registry: docker.pkg.github.com
push_git_tag: true

- name: Publish package to NPM
if: steps.create_release.outcome == 'Success'
run: |
docker run docker.pkg.github.com/halvardssm/package-translation-fetch/translations echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
docker run docker.pkg.github.com/halvardssm/package-translation-fetch/translations yarn publish --non-interactive
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc && yarn pack && yarn publish translation-fetch-v${{steps.check.outputs.version}}.tgz --non-interactive
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "translation-fetch",
"version": "0.1.10",
"version": "0.1.11",
"repository": "github.com/halvardssm/package-translation-fetch.git",
"author": "Halvard Mørstad <[email protected]>",
"license": "MIT",
Expand All @@ -11,14 +11,13 @@
"dist/*"
],
"scripts": {
"build": "yarn run lint && tsc && chmod +x ./dist/*",
"build:image": "docker build -t translations -f .github/Dockerfile .",
"build": "yarn && yarn run lint && tsc && chmod +x ./dist/*",
"lint": "eslint --ext .ts src",
"lint:fix": "eslint --ext .ts src --fix",
"prepack": "yarn build",
"pretest": "yarn build",
"test": "dist/bin.js",
"test:ts": "ts-node src/bin.ts",
"test:image": "yarn run build:image && docker run translations yarn test"
"test:ts": "ts-node src/bin.ts"
},
"dependencies": {
"commander": "^5.1.0",
Expand Down

0 comments on commit 2e4d98a

Please sign in to comment.