diff --git a/.github/actions/upload-dated-artifact/action.yaml b/.github/actions/upload-dated-artifact/action.yaml new file mode 100644 index 0000000..7fc3fbe --- /dev/null +++ b/.github/actions/upload-dated-artifact/action.yaml @@ -0,0 +1,26 @@ +name: Upload dated artifact +description: Uploads an artifact with a datetime + +inputs: + name: + description: The name of the artifact + required: true + path: + description: The path to the file/folder to upload + required: true + +runs: + using: composite + steps: + # https://stackoverflow.com/questions/60942067/get-current-date-and-time-in-github-workflows + - name: Get current datetime + id: date + shell: bash + run: echo "::set-output name=date::$(date '+%Y-%m-%d_%H-%M-%S')" + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.name }}_${{ steps.date.outputs.date }} + path: ${{ inputs.path }} + if-no-files-found: error diff --git a/.github/workflows/create-binaries.yaml b/.github/workflows/create-binaries.yaml index 02bb4b9..26572bc 100644 --- a/.github/workflows/create-binaries.yaml +++ b/.github/workflows/create-binaries.yaml @@ -34,11 +34,10 @@ jobs: cp -r models ${{ env.dist-path }} - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: ./.github/actions/upload-dated-artifact with: - name: windows-latest + name: windows path: dist # Add the parent directory to prevent a tarbomb - if-no-files-found: error # Files must be packed into a tar in order for file permissions to be preserved build-unix: @@ -48,7 +47,11 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + include: + - name: linux + os: ubuntu-latest + - name: mac + os: macos-latest runs-on: ${{ matrix.os }} steps: - name: Pull OpenSeeFace @@ -78,8 +81,7 @@ jobs: run: tar -cvf ${{ env.tar-path }} ${{ env.artifact-path }} - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: ./.github/actions/upload-dated-artifact with: - name: ${{ matrix.os }} + name: ${{ matrix.name }} path: ${{ env.tar-path }} - if-no-files-found: error