From 382b496c5fd32d19f7991bc034d2ed54d95e5703 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Wed, 21 Aug 2024 21:40:19 -0700 Subject: [PATCH] github: Update FreeBSD Test - Passing bitcoind version from matrix - cleanup: Removed extra tabs and `-` from pypi.yml Changelog-Fixed: Github action for FreeBSD setup --- .github/workflows/bsd.yml | 27 ++++--- .github/workflows/pypi.yml | 158 ++++++++++++++++++------------------- 2 files changed, 94 insertions(+), 91 deletions(-) diff --git a/.github/workflows/bsd.yml b/.github/workflows/bsd.yml index 7868003cd..206acd11f 100644 --- a/.github/workflows/bsd.yml +++ b/.github/workflows/bsd.yml @@ -11,6 +11,10 @@ jobs: runs-on: ubuntu-latest name: Build and test on FreeBSD timeout-minutes: 120 + strategy: + fail-fast: true + matrix: + bitcoind-version: ["27.1"] steps: - uses: actions/checkout@v4 - name: Test in FreeBSD @@ -20,9 +24,9 @@ jobs: usesh: true prepare: | pkg install -y \ + bash \ wget \ - py38-pip \ - py38-sqlite3 \ + python38 \ gmake \ git \ python \ @@ -36,16 +40,16 @@ jobs: lowdown \ curl - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2021-08-3z1 + python3.8 -m ensurepip + python3.8 -m pip install --upgrade pip + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2021-08-3z1 + + cd /tmp/ || exit 1 + wget https://bitcoincore.org/bin/bitcoin-core-${{ matrix.bitcoind-version }}/bitcoin-${{ matrix.bitcoind-version }}-x86_64-linux-gnu.tar.gz + tar -xf bitcoin-${{ matrix.bitcoind-version }}-x86_64-linux-gnu.tar.bz2 + sudo mv bitcoin-${{ matrix.bitcoind-version }}/bin/* /usr/local/bin + rm -rf bitcoin-${{ matrix.bitcoind-version }}-x86_64-linux-gnu.tar.gz bitcoin-${{ matrix.bitcoind-version }} - cd /tmp/ || exit 1 - wget https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-x86_64-linux-gnu.tar.gz - tar -xf bitcoin-27.1-x86_64-linux-gnu.tar.bz2 - sudo mv bitcoin-27.1/bin/* /usr/local/bin - rm -rf \ - bitcoin-27.1-x86_64-linux-gnu.tar.gz \ - bitcoin-27.1 - run: | PATH=/root/.local/bin:$PATH pip install --user -U wheel pip @@ -84,4 +88,3 @@ jobs: # Clean up to maximize rsync's chances of succeeding gmake clean - diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index efdeafc63..038d49fb1 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,79 +1,79 @@ ---- - name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI - on: - push: - tags: - '^v[0-9]{2}\.[0-9]{2}(\.[0-9]{1,2})?$' - workflow_dispatch: - jobs: - deploy: - name: Build and publish ${{ matrix.package }} 🐍 - runs-on: ubuntu-20.04 - timeout-minutes: 120 - strategy: - fail-fast: true - matrix: - include: - - PACKAGE: pyln-client - WORKDIR: contrib/pyln-client - - PACKAGE: pyln-testing - WORKDIR: contrib/pyln-testing - - PACKAGE: pyln-proto - WORKDIR: contrib/pyln-proto - - PACKAGE: pyln-grpc-proto - WORKDIR: contrib/pyln-grpc-proto - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - # Need to fetch entire history in order to locate the version tag - fetch-depth: 0 - - - name: Check version tag - run: >- - git describe --always --dirty=-modded --abbrev=7 - - - name: Setup Version - env: - WORKDIR: ${{ matrix.WORKDIR }} - run: | - echo "VERSION=$(git describe --abbrev=0).post$(git describe --abbrev=1 | awk -F "-" '{print $2}')" >> $GITHUB_ENV - - - name: Install Poetry - env: - WORKDIR: ${{ matrix.WORKDIR }} - run: | - curl -sSL https://install.python-poetry.org | python3 - - echo "$HOME/.local/bin" >> $GITHUB_PATH - echo "PATH=$HOME/.local/bin:$PATH" - - - name: Publish distribution 📦 to Test PyPI - if: github.event_name == 'workflow_dispatch' && github.repository == 'ElementsProject/lightning' - env: - POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }} - WORKDIR: ${{ matrix.WORKDIR }} - run: | - echo "POETRY VERSION TEST: $(poetry --version)" - echo "Pyln* VERSION: $VERSION" - cd ${{ env.WORKDIR }} - python3 -m pip config set global.timeout 150 - poetry config repositories.testpypi https://test.pypi.org/legacy/ - make upgrade-version NEW_VERSION=$VERSION - poetry build --no-interaction - poetry publish --repository testpypi --no-interaction --skip-existing - - - name: Publish distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'ElementsProject/lightning' - env: - POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} - WORKDIR: ${{ matrix.WORKDIR }} - run: | - echo "POETRY VERSION PUBLISH: $(poetry --version)" - echo "Pyln* VERSION: $VERSION" - cd ${{ env.WORKDIR }} - export VERSION=$(git describe --abbrev=0) - make upgrade-version NEW_VERSION=$VERSION - python3 -m pip config set global.timeout 150 - poetry build --no-interaction - poetry publish --no-interaction - \ No newline at end of file +name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI + +on: + push: + tags: + '^v[0-9]{2}\.[0-9]{2}(\.[0-9]{1,2})?$' + workflow_dispatch: + +jobs: + deploy: + name: Build and publish ${{ matrix.package }} 🐍 + runs-on: ubuntu-20.04 + timeout-minutes: 120 + strategy: + fail-fast: true + matrix: + include: + - PACKAGE: pyln-client + WORKDIR: contrib/pyln-client + - PACKAGE: pyln-testing + WORKDIR: contrib/pyln-testing + - PACKAGE: pyln-proto + WORKDIR: contrib/pyln-proto + - PACKAGE: pyln-grpc-proto + WORKDIR: contrib/pyln-grpc-proto + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + # Need to fetch entire history in order to locate the version tag + fetch-depth: 0 + + - name: Check version tag + run: >- + git describe --always --dirty=-modded --abbrev=7 + + - name: Setup Version + env: + WORKDIR: ${{ matrix.WORKDIR }} + run: | + echo "VERSION=$(git describe --abbrev=0).post$(git describe --abbrev=1 | awk -F "-" '{print $2}')" >> $GITHUB_ENV + + - name: Install Poetry + env: + WORKDIR: ${{ matrix.WORKDIR }} + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo "$HOME/.local/bin" >> $GITHUB_PATH + echo "PATH=$HOME/.local/bin:$PATH" + + - name: Publish distribution 📦 to Test PyPI + if: github.event_name == 'workflow_dispatch' && github.repository == 'ElementsProject/lightning' + env: + POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }} + WORKDIR: ${{ matrix.WORKDIR }} + run: | + echo "POETRY VERSION TEST: $(poetry --version)" + echo "Pyln* VERSION: $VERSION" + cd ${{ env.WORKDIR }} + python3 -m pip config set global.timeout 150 + poetry config repositories.testpypi https://test.pypi.org/legacy/ + make upgrade-version NEW_VERSION=$VERSION + poetry build --no-interaction + poetry publish --repository testpypi --no-interaction --skip-existing + + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'ElementsProject/lightning' + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} + WORKDIR: ${{ matrix.WORKDIR }} + run: | + echo "POETRY VERSION PUBLISH: $(poetry --version)" + echo "Pyln* VERSION: $VERSION" + cd ${{ env.WORKDIR }} + export VERSION=$(git describe --abbrev=0) + make upgrade-version NEW_VERSION=$VERSION + python3 -m pip config set global.timeout 150 + poetry build --no-interaction + poetry publish --no-interaction