vpenades 1 سال پیش
والد
کامیت
99b81b1f82
3فایلهای تغییر یافته به همراه8 افزوده شده و 130 حذف شده
  1. 0 55
      .github/workflows/BuildPackages.yml
  2. 8 16
      .github/workflows/PublishToNuget.yml
  3. 0 59
      .github/workflows/PushGithubTag.yml

+ 0 - 55
.github/workflows/BuildPackages.yml

@@ -1,55 +0,0 @@
-name: Build packages and store artifacts
-
-on:
-
-  workflow_dispatch:
-    inputs:
-      nuget-semver:
-        type: string
-        description: 'package version'
-        required: false
-        default: '1.0.0-Test-DATE-TIME'
-
-  workflow_call:
-    inputs:
-      nuget-semver:
-        type: string
-        description: 'package version'
-        required: true
-        default: '1.0.0-Test-DATE-TIME'
-    
-jobs:
-  build_job:
-
-    runs-on: ubuntu-latest    
-    timeout-minutes: 5
-
-    steps:
-
-      # ---------------------------------------------  DotNet SDK
-
-    - name: Setup .NET SDK
-      uses: actions/setup-dotnet@v4
-
-      # ---------------------------------------------  checkout repo
-
-    - name: Checkout
-      uses: actions/checkout@v4
-
-      # ---------------------------------------------  build
-
-    - name: Build
-      run: |
-        chmod +x ./SharpGLTF.Build.sh
-        ./SharpGLTF.Build.sh ${{inputs.nuget-semver}}
-
-      # ---------------------------------------------  publish
-
-    - name: Archive
-      uses: actions/upload-artifact@v4
-      with:
-        name: nuget-packages
-        retention-days: 1
-        path: |
-            *.nupkg
-            *.snupkg

+ 8 - 16
.github/workflows/PublishToNuget.yml

@@ -1,11 +1,13 @@
-name: Publish artifacts to Nuget
+name: Publish artifacts to Github
 
 on: workflow_dispatch
     
 jobs:
 
-  prepare_job: #---------------------------------------------------------------------------------------
+  main_job:
     runs-on: ubuntu-latest
+    permissions:
+      contents: write # required for pushing the tag    
     
     steps:
 
@@ -17,20 +19,10 @@ jobs:
         chmod +x ./.github/workflows/FormatSemver.sh
         ./.github/workflows/FormatSemver.sh "${{ vars.SharpGLTF_Version }}-Alpha${{ vars.SharpGLTF_AlphaVersion }}" >> $GITHUB_ENV
 
-    outputs:
-      semver: "${{env.GHENV_PACKAGEVERSION}}" 
-
-  build_job: #---------------------------------------------------------------------------------------
-    needs: prepare_job
-    uses: ./.github/workflows/BuildPackages.yml
-    with:
-      nuget-semver: "${{needs.prepare_job.outputs.semver}}"
-
-  publish_job: #---------------------------------------------------------------------------------------
-    needs: build_job
-    runs-on: ubuntu-latest
-
-    steps:
+    - name: build
+      uses: ./.github/actions/Build
+      with:
+        nuget-semver: "${{env.GHENV_PACKAGEVERSION}}"
 
     - name: Download all artifacts
       uses: actions/download-artifact@v4

+ 0 - 59
.github/workflows/PushGithubTag.yml

@@ -1,59 +0,0 @@
-name: Push a new github tag
-
-on:
-
-  workflow_dispatch:
-    inputs:
-      tag-name:
-        type: string
-        description: 'name of the tag'
-        required: true
-        default: 'tag'
-      message:
-        type: string
-        description: 'message'
-        required: false
-        default: 'message'
-
-  workflow_call:
-    inputs:
-      tag-name:
-        type: string
-        description: 'name of the tag'
-        required: true
-        default: 'tag'
-      message:
-        type: string
-        description: 'message'
-        required: false
-        default: 'message'
-    
-jobs:
-  build_job:
-
-    runs-on: ubuntu-latest    
-    timeout-minutes: 1
-    permissions:
-      contents: write # required for pushing the tag
-
-    steps:    
-
-    - name: Checkout
-      uses: actions/checkout@v4
-
-    # https://github.com/orgs/community/discussions/40405
-    - run: |
-        git config --global user.name "${{ github.actor }}"
-        git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
-        git tag -a "${{inputs.tag-name}}" -m "${{inputs.message}}"
-        git push origin "${{inputs.tag-name}}"
-
-    # # alternative solution:
-    # # https://github.com/rickstaa/action-create-tag
-    # - name: create tag
-    #   uses: rickstaa/action-create-tag@v1
-    #   id: "tag_create"
-    #   with:
-    #     tag: "${{inputs.tag-name}}"
-    #     tag_exists_error: true
-    #     message: "${{inputs.message}}"