fix #114
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- '*' | |
release: | |
types: | |
- created | |
workflow_dispatch: | |
jobs: | |
build-and-attach: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build project | |
run: npm pack | |
- name: Extract version from package.json | |
id: get_version | |
run: | | |
version=$(jq -r .version package.json) | |
echo "::set-output name=version::$version" | |
- name: Upload artifact to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
layr-labs-zeus-${{ steps.get_version.outputs.version }}.tgz | |
file_glob: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Upload binary to S3 | |
run: | | |
aws s3 cp layr-labs-zeus-${{ steps.get_version.outputs.version }}.tgz s3://zeus-distribution/zeus-${{ steps.get_version.outputs.version }}.tgz | |