Skip to content

adjust

adjust #5

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
run: npx oclif@3.0.1 pack tarballs
- name: upload
id: upload
run: |
UPLOAD_OUTPUT=$(npx oclif@3.0.1 upload tarballs)
echo "$UPLOAD_OUTPUT"
echo "::set-output name=sha::$(echo "$UPLOAD_OUTPUT" | grep -oP '(?<=dotenv-vault-v[0-9.]+-)\w+(?=-linux-x64.tar.gz)')"
echo "::set-output name=version::$(echo "$UPLOAD_OUTPUT" | grep -oP '(?<=dotenv-vault@)[^ ]+')"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: promote
run: |
echo "${{ steps.upload }}"
PROMOTE_VERSION=$(echo ${{ steps.upload.outputs.version }})
PROMOTE_SHA=$(echo ${{ steps.upload.outputs.sha }})
npx oclif@3.0.1 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 }}