diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 00000000..dd4d2b2a --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,72 @@ +name: Python Fire Prerelease + +on: + push: + branches: + - "autobuild" + workflow_dispatch: # click the button on Github repo! + +jobs: + pre-release: + name: Build pre-release wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + # - os: ubuntu-latest + # python: 38 + # platform_id: manylinux_x86_64 + # manylinux_image: manylinux2014 + # python-version: 3.8 + - os: ubuntu-latest + python: 39 + platform_id: manylinux_x86_64 + manylinux_image: manylinux2014 + python-version: 3.9 + + steps: + # Checkout the repo. + - name: Checkout Python Fire repository + uses: actions/checkout@v3 + + # Set up Python environment. + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install wheel + run: | + python -m pip install --upgrade setuptools pip + python -m pip install wheel six termcolor + # # Build Python Fire using the build.sh script. + # - name: Run build script + # shell: bash + # run: ./.github/scripts/build-prerelease.sh + # env: + # PYTHON_VERSION: ${{ matrix.python-version }} + + - name: Run build wheels + run: pip wheel -w wheelhouse/ . + env: + PYTHON_VERSION: ${{ matrix.python-version }} + + # - name: Store artifacts + # uses: actions/upload-artifact@v3 + # with: + # path: wheelhouse/fire*.whl + + - name: Get current date + id: date + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "v${{ env.date }}" + prerelease: true + title: "Automatic Build ${{ env.date }}" + files: | + wheelhouse/fire*.whl + diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml new file mode 100644 index 00000000..a0e6ba3b --- /dev/null +++ b/.github/workflows/upstream.yml @@ -0,0 +1,46 @@ +name: 'Upstream Sync' + +on: + schedule: + - cron: '0 7 * * *' + # scheduled at 07:00 every Monday and Thursday + + workflow_dispatch: # click the button on Github repo! + +jobs: + sync_latest_from_upstream: + runs-on: ubuntu-latest + name: Sync latest commits from upstream repo + + steps: + # REQUIRED step + # Step 1: run a standard checkout action, provided by github + - name: Checkout target repo + uses: actions/checkout@v2 + + # REQUIRED step + # Step 2: run the sync action + - name: Sync upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + target_sync_branch: master + # REQUIRED 'target_repo_token' exactly like this! + target_repo_token: ${{ secrets.GITHUB_TOKEN }} + upstream_sync_branch: master + upstream_sync_repo: google/python-fire + + # Set test_mode true to run tests instead of the true action!! + # test_mode: true + + # Step 3: Display a sample message based on the sync output var 'has_new_commits' + - name: New commits found + if: steps.sync.outputs.has_new_commits == 'true' + run: echo "New commits were found to sync." + + - name: No new commits + if: steps.sync.outputs.has_new_commits == 'false' + run: echo "There were no new commits." + + - name: Show value of 'has_new_commits' + run: echo ${{ steps.sync.outputs.has_new_commits }}