From 9cc54dd9f96bb1488d52633d176d97b2b24121dc Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Tue, 28 Nov 2023 13:34:57 +0000 Subject: [PATCH 1/4] ci: create final releases After many months, this mechanism has proven reliable, and leaving the releases as draft creates menial work. Instead create non-draft releases. Signed-off-by: Pau Ruiz Safont --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96ac24405f8..61da494de13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: path: dist/ - name: Draft Release ${{ github.ref_name }} - run: gh release create ${{ github.ref_name }} --draft --generate-notes + run: gh release create ${{ github.ref_name }} --generate-notes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 01254d6ed81f35529ddd11395574ed4154279025 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Tue, 28 Nov 2023 13:45:32 +0000 Subject: [PATCH 2/4] ci: Simplify release workflow The checkout content is not needed and the artifact upload can be done at the same time as the release creation. Also change names of the workflow steps to be more specific Signed-off-by: Pau Ruiz Safont --- .github/workflows/release.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61da494de13..2d17ebc707b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - 'v*' jobs: - build: + build-python: runs-on: ubuntu-latest env: XAPI_VERSION: ${{ github.ref_name }} @@ -39,28 +39,20 @@ jobs: release: runs-on: ubuntu-latest - needs: build + needs: build-python steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Retrieve python distribution artifacts uses: actions/download-artifact@v3 with: name: XenAPI path: dist/ - - name: Draft Release ${{ github.ref_name }} - run: gh release create ${{ github.ref_name }} --generate-notes - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload artifacts - run: gh release upload ${{ github.ref_name }} dist/* + - name: Create release ${{ github.ref_name }} + run: gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --generate-notes dist/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - publish: + publish-pypi: runs-on: ubuntu-latest needs: release environment: pypi From b56557df84da1e29ffca78bc503126eb34ddd304 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Tue, 28 Nov 2023 14:38:42 +0000 Subject: [PATCH 3/4] ci: set up configure appropriately on release Accidentally XAPI_VERSION was used because xapi-version was not recognised. Remove the first and set the second one to avoid readers' confusion Signed-off-by: Pau Ruiz Safont --- .github/workflows/release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d17ebc707b..8f55374239b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,8 +8,6 @@ on: jobs: build-python: runs-on: ubuntu-latest - env: - XAPI_VERSION: ${{ github.ref_name }} steps: - name: Checkout code @@ -27,7 +25,7 @@ jobs: - name: Generate python package for XenAPI run: | - ./configure --xapi-version=${{ github.ref_name }} + ./configure --xapi_version=${{ github.ref_name }} make python - name: Store python distribution artifacts From e84759a6931146c7326a7a23bb241a7229b12fa6 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Tue, 28 Nov 2023 14:47:47 +0000 Subject: [PATCH 4/4] ci: Avoid unnecessary workaround xapi_version in configure is properly overriden so the git tag is not needed to work around dune's behaviour. Signed-off-by: Pau Ruiz Safont --- .github/workflows/main.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fbc14fa93f0..cc372dfd10f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,15 +42,6 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - # The checkout action performs a shallow, this triggers dune to set the - # version to -dirty. Work around this dune behaviour and tag the - # commit so a proper version is always picked up - - name: Tag current commit - run: | - git config user.name "Dune workaround" - git config user.email "<>" - git tag -am "workaround for dune" "$XAPI_VERSION" - - name: Pull configuration from xs-opam run: | curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env | cut -f2 -d " " > .env