Skip to content

update ci

update ci #3

Workflow file for this run

name: ci
on: push
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16.x
- run: npm install
- run: npm run test
# run only on semantic version tag
release:
needs: test
# if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '.')
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: checkout
uses: actions/checkout@v4
# # GITHUB_ENV operates like a .env file
# - name: extract version
# run: |
# VERSION=${GITHUB_REF#refs/tags/}
# CLEAN_VERSION=${VERSION#v}
# echo "VERSION=$VERSION" >> $GITHUB_ENV
# echo "CLEAN_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV
- name: node
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: npm install
run: npm install
- name: dist
run: |
mkdir -p dist
- name: pack
id: pack
run: |
PACK_OUTPUT=$(npx [email protected] pack tarballs)
echo "$PACK_OUTPUT"
echo "::set-output name=version::$(echo "$PACK_OUTPUT" | grep 'dotenv-vault@' | awk '{print $2}')"
echo "::set-output name=sha::$(echo "$PACK_OUTPUT" | grep 'shasum' | awk '{print $3}')"
- name: upload
run: |
npx [email protected] upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: promote
run: |
PROMOTE_VERSION=$(echo ${{ steps.pack.outputs.version }})
PROMOTE_SHA=$(echo ${{ steps.pack.outputs.sha }})
npx [email protected] promote --version "$PROMOTE_VERSION" --sha "$PROMOTE_SHA"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}