Skip to content

Commit

Permalink
generate release
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed Jun 18, 2024
1 parent ac9faee commit 721160f
Showing 1 changed file with 6 additions and 35 deletions.
41 changes: 6 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,9 @@ jobs:
- name: pack
run: npx [email protected] pack tarballs

- name: extract sha
id: extract_sha
run: |
# list files in dist directory
ls dist/
# extract version and SHA from the filename
FILENAME=$(ls dist/ | grep 'dotenv-vault-v.*-linux-x64.tar.gz' | head -n 1)
echo "extracted filename: $FILENAME"
VERSION=$(echo $FILENAME | grep -oP '(?<=dotenv-vault-v)[0-9.]+(?=-)')
SHA=$(echo $FILENAME | grep -oP '(?<=dotenv-vault-v[0-9.]+-)[^-]+(?=-linux-x64.tar.gz)')
echo "Extracted version: $VERSION"
echo "Extracted SHA: $SHA"
# Set outputs
echo "::set-output name=version::$VERSION"
echo "::set-output name=sha::$SHA"
- name: upload
run: npx [email protected] upload tarballs
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.extract_sha.outputs.version }})
PROMOTE_SHA=$(echo ${{ steps.extract_sha.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 }}
- name: create release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.tar.gz
body: "see [CHANGELOG](https://github.com/dotenv-org/dotenv-vault/blob/master/CHANGELOG.md)"

0 comments on commit 721160f

Please sign in to comment.