Skip to content

Commit

Permalink
Using GITHUB_ENV in github actions, as set-env is deprecated. Reforma…
Browse files Browse the repository at this point in the history
…tted workflow yaml.
  • Loading branch information
gguridi committed Aug 16, 2021
1 parent efae56e commit 2be5661
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish

on:
release:
types:
types:
- created

jobs:
Expand All @@ -13,36 +13,36 @@ jobs:
matrix:
nodejs: [11, 12, 13, 14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.nodejs }}
- name: install dependencies
run: yarn install
- name: build and run mockserver docker
run: yarn run docker-build && yarn run docker-run
- name: run tests
run: yarn test
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.nodejs }}
- name: install dependencies
run: yarn install
- name: build and run mockserver docker
run: yarn run docker-build && yarn run docker-run
- name: run tests
run: yarn test

publish:
needs:
needs:
- mockserver-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set version envvar
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11})
- name: set release version on package.json
run: sed -i.bak 's/0\.0\.0/'$RELEASE_VERSION'/g' package.json
- name: check package
run: cat package.json
- uses: actions/setup-node@v1
with:
node-version: 13
- name: install dependencies
run: yarn install
- name: run build
run: yarn build
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- uses: actions/checkout@v2
- name: set version envvar
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:11})" >> $GITHUB_ENV
- name: set release version on package.json
run: sed -i.bak 's/0\.0\.0/'$RELEASE_VERSION'/g' package.json
- name: check package
run: cat package.json
- uses: actions/setup-node@v1
with:
node-version: 13
- name: install dependencies
run: yarn install
- name: run build
run: yarn build
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

0 comments on commit 2be5661

Please sign in to comment.