diff --git a/.github/workflows/build-nightly.yml b/.github/workflows/build-nightly.yml new file mode 100644 index 000000000000..225500a8cb36 --- /dev/null +++ b/.github/workflows/build-nightly.yml @@ -0,0 +1,33 @@ +name: build-nightly +run-name: ${{ github.workflow }} is to create nightly wheel file for pypi +on: + push: + branches: + - 'main' + schedule: + - cron: '0 0 * * *' +jobs: + build-nightly: + runs-on: ubuntu-22.04 + permissions: + id-token: write + contents: read + steps: + - uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: arn:aws:iam::498127099666:role/WebIdentity-nm-github-actions-only + aws-region: us-east-1 + - uses: actions/checkout@v3 + - run: | + pwd + sudo apt-get install python3-pip + pip3 --version + sudo pip3 install virtualenv + virtualenv venv + source venv/bin/activate + pip install -e . + make -B build + deactivate + ls dist/ + aws s3 ls s3://nm-github-actions/ + aws s3 cp dist/*nightly*.whl s3://nm-github-actions/transformers/ diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 000000000000..f4cfbebc7535 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,33 @@ +name: build-release +run-name: ${{ github.workflow }} is to create release wheel file for pypi +on: + push: + branches: + - 'release/[0-9]+.[0-9]+' + +jobs: + build-release: + runs-on: ubuntu-22.04 + permissions: + id-token: write + contents: read + steps: + - uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: arn:aws:iam::498127099666:role/WebIdentity-nm-github-actions-only + aws-region: us-east-1 + - uses: actions/checkout@v3 + - run: | + pwd + sudo apt-get install python3-pip + pip3 --version + sudo pip3 install virtualenv + virtualenv venv + source venv/bin/activate + pip install -e . + sed -i 's/is_release = False/is_release = True/g' src/transformers/version.py + make -B build + deactivate + ls dist/ + aws s3 ls s3://nm-github-actions/ + aws s3 cp dist/*.whl s3://nm-github-actions/transformers/