From 3b10201e01a601a2393c57cd19c768e3b6a6f879 Mon Sep 17 00:00:00 2001 From: Tyler Fox Date: Tue, 23 Jul 2024 16:24:36 -0700 Subject: [PATCH] Upload the full module as an artifact when testing (#28) Upload the full module as an artifact when testing --- .github/workflows/main.yml | 42 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9afcd3..c5a61c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,7 +44,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true @@ -67,7 +67,7 @@ jobs: Copy-Item "./build/${{env.BUILD_TYPE}}/TwistSpline.mll" -Destination "artifacts/plug-ins" - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: windows-${{matrix.maya}} path: | @@ -89,7 +89,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true @@ -115,7 +115,7 @@ jobs: cp ./build/${{env.BUILD_TYPE}}/TwistSpline.bundle artifacts/plug-ins - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: mac-${{matrix.maya}} path: | @@ -137,7 +137,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true @@ -163,7 +163,7 @@ jobs: cp ./build/${{env.BUILD_TYPE}}/TwistSpline.bundle artifacts/plug-ins - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: mac-${{matrix.maya}} path: | @@ -188,7 +188,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true @@ -213,7 +213,7 @@ jobs: cp "./build/TwistSpline.so" "artifacts/plug-ins" - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: linux-${{matrix.maya}} path: | @@ -236,15 +236,12 @@ jobs: needs: [maya-win, maya-linux, maya-macos-x86_64, maya-macos-arm64] runs-on: ubuntu-latest - # Only run on e.g. v0.1.0 - if: startsWith(github.ref, 'refs/tags/v') - steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 # Omitting name: means "download all artifacts" # Destination directory structure: @@ -263,7 +260,10 @@ jobs: path: modules/TwistSpline - name: Set env - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + run: | + LATEST_TAG=$(git describe --tags --abbrev=0 || echo "NOTAG") + echo "LatestTag: ${LATEST_TAG}" + echo "RELEASE_VERSION=${LATEST_TAG}" >> $GITHUB_ENV - name: Create distribution run: | @@ -275,11 +275,17 @@ jobs: cp ./icons/*.xpm modules/TwistSpline/icons zip -r TwistSpline-${{env.RELEASE_VERSION}}.zip modules/ + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: TwistSpline-module + path: TwistSpline-${{env.RELEASE_VERSION}}.zip + - name: Upload distribution - uses: "marvinpinto/action-automatic-releases@latest" + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + uses: softprops/action-gh-release@v1 with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" + token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false files: | - TwistSpline-*.zip + *.zip