Skip to content

Commit

Permalink
Use publish job for M1 wheels too
Browse files Browse the repository at this point in the history
  • Loading branch information
Starttoaster committed Sep 27, 2023
1 parent f715476 commit 85f521f
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions .github/workflows/build-m1-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,32 @@ jobs:
name: wheels
path: ./target/wheels

- name: Test for secrets access
id: check_secrets
shell: bash
run: |
unset HAS_AWS_SECRET
if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi
echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT
env:
AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}"
upload:
name: Upload to PyPI
runs-on: ubuntu-latest
needs: build_wheels
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install python
uses: Chia-Network/actions/setup-python@main
with:
python-version: "3.10"

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: ./target/wheels/

- name: publish (PyPi)
if: env.RELEASE == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -142,6 +152,17 @@ jobs:
packages-dir: target/wheels/
skip-existing: true

- name: Test for secrets access
id: check_secrets
shell: bash
run: |
unset HAS_AWS_SECRET
if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi
echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT
env:
AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}"

- name: Configure AWS credentials
if: steps.check_secrets.outputs.HAS_AWS_SECRET
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -151,9 +172,11 @@ jobs:

- name: Publish Dev
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/dev'
shell: bash
working-directory: ./target/wheels
run: |
FILES=$(find ${{ github.workspace }}/target/wheels -type f -name '*.whl')
FILES=$(find . -type f -name '*.whl')
while IFS= read -r file; do
filename=$(basename $file)
aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename"
done <<< "$FILES"
done <<< "$FILES"

0 comments on commit 85f521f

Please sign in to comment.