Skip to content

Instantly share code, notes, and snippets.

@tsavo-at-pieces
Created June 7, 2023 21:44
Show Gist options
  • Save tsavo-at-pieces/89f4bf71054b8432620c4b24a45b98c3 to your computer and use it in GitHub Desktop.
Save tsavo-at-pieces/89f4bf71054b8432620c4b24a45b98c3 to your computer and use it in GitHub Desktop.
Helpful config for restoring module

reusable-module-composition.yaml

Preview:
- name: Diff Restored Module Executables && Enable Existing Executables (Windows)
        if: matrix.config.system_information.operating_system_family == 'windows' && steps.cache-aot-module-executables.outputs.cache-hit == 'true'
        run: |
          $executables = @()
          $distDirs = Get-ChildItem -Path . -Recurse -Directory -Filter dist
          foreach ($dir in $distDirs) {
            $cliExecutables = Get-ChildItem -Path $dir.FullName -File -Include *_cli.exe
            foreach ($executable in $cliExecutables) {
              $executables += $executable.FullName
              $executable.Attributes = $executable.Attributes -bxor [System.IO.FileAttributes]::ReadOnly 
              Set-ItemProperty -Path $executable.FullName -Name IsReadOnly -Value $false
              Write-Output "Changed permissions for $($executable.FullName)"
              echo "Restored module executable $($executable.FullName)"
            }
          }
          $executableList = ($executables -join ',')
          echo "EXECUTABLES=$executableList" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
        shell: powershell

      - name: Restore Cache Generated Dockerfiles (Ubuntu Only)
        if: matrix.config.system_information.operating_system_family == 'linux'
        id: cache-dockerfiles
        uses: actions/[email protected]
        with:
          path: ${{ github.workspace }}
          key: dockerfile-cache-${{ matrix.config.system_information.operating_system_family }}-${{ matrix.config.system_information.kernel_architecture }}-${{ hashFiles('/packages/aot/**/Dockerfile') }}-${{ hashFiles('**/pubspec.lock') }}
          restore-keys: dockerfile-cache-${{ matrix.config.system_information.operating_system_family }}-${{ matrix.config.system_information.kernel_architecture }}-
Associated Context
Type Code Snippet ( .yaml )
Associated Tags jenkins-plugins maven-release-plugin System Architecture Executables Management Runtime Configuration Command Line Interface hudson Restore Keys File Attributes code-signing artifactory Environment Variables Runtime Information Windows OS
Description This snippet is from lines (164,191) inside the file reusable-module-composition.yaml and from project native_io.
Related Links No Related Links
Related People Tsavo Knott
Sensitive Information No Sensitive Information Detected
Shareable Link https://tsavo.pieces.cloud/?p=f82c419d1f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment