diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 858e84f..1ae87d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,7 @@ permissions: contents: read pages: write id-token: write + packages: write concurrency: group: main @@ -35,6 +36,11 @@ jobs: build-linux: runs-on: ubuntu-latest + env: + USERNAME: asfernandes + VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg + FEED_URL: https://nuget.pkg.github.com/asfernandes/index.json + VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/asfernandes/index.json,readwrite" steps: - name: Checkout repository uses: actions/checkout@v4 @@ -67,7 +73,8 @@ jobs: graphviz \ ninja-build \ libtommath1 \ - libtomcrypt1 + libtomcrypt1 \ + mono-complete - name: Install Firebird run: | @@ -87,6 +94,20 @@ jobs: run: | ./vcpkg/bootstrap-vcpkg.sh -disableMetrics + - name: Configure vcpkg binary caching + if: github.repository == 'asfernandes/fb-cpp' + run: | + mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ + sources add \ + -Source "${{ env.FEED_URL }}" \ + -StorePasswordInClearText \ + -Name GitHubPackages \ + -UserName "${{ env.USERNAME }}" \ + -Password "${{ secrets.GITHUB_TOKEN }}" + mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ + setapikey "${{ secrets.GITHUB_TOKEN }}" \ + -Source "${{ env.FEED_URL }}" + - name: Configure CMake run: | cp CMakeUserPresets.json.posix.template CMakeUserPresets.json @@ -119,6 +140,11 @@ jobs: build-windows: runs-on: windows-latest + env: + USERNAME: asfernandes + VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg + FEED_URL: https://nuget.pkg.github.com/asfernandes/index.json + VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/asfernandes/index.json,readwrite" steps: - name: Checkout repository uses: actions/checkout@v4 @@ -163,6 +189,21 @@ jobs: run: | vcpkg\bootstrap-vcpkg.bat -disableMetrics + - name: Configure vcpkg binary caching + if: github.repository == 'asfernandes/fb-cpp' + shell: pwsh + run: | + .$(${{ env.VCPKG_EXE }} fetch nuget) ` + sources add ` + -Source "${{ env.FEED_URL }}" ` + -StorePasswordInClearText ` + -Name GitHubPackages ` + -UserName "${{ env.USERNAME }}" ` + -Password "${{ secrets.GITHUB_TOKEN }}" + .$(${{ env.VCPKG_EXE }} fetch nuget) ` + setapikey "${{ secrets.GITHUB_TOKEN }}" ` + -Source "${{ env.FEED_URL }}" + - name: Configure CMake shell: cmd run: | @@ -189,6 +230,11 @@ jobs: build-macos: runs-on: macos-latest + env: + USERNAME: asfernandes + VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg + FEED_URL: https://nuget.pkg.github.com/asfernandes/index.json + VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/asfernandes/index.json,readwrite" steps: - name: Checkout repository uses: actions/checkout@v4 @@ -214,7 +260,8 @@ jobs: autoconf \ autoconf-archive \ automake \ - libtool + libtool \ + mono - name: Install Firebird run: | @@ -233,6 +280,20 @@ jobs: run: | ./vcpkg/bootstrap-vcpkg.sh -disableMetrics + - name: Configure vcpkg binary caching + if: github.repository == 'asfernandes/fb-cpp' + run: | + mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ + sources add \ + -Source "${{ env.FEED_URL }}" \ + -StorePasswordInClearText \ + -Name GitHubPackages \ + -UserName "${{ env.USERNAME }}" \ + -Password "${{ secrets.GITHUB_TOKEN }}" + mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ + setapikey "${{ secrets.GITHUB_TOKEN }}" \ + -Source "${{ env.FEED_URL }}" + - name: Configure CMake run: | cp CMakeUserPresets.json.posix.template CMakeUserPresets.json diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 52e1bf8..b7ba38b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -6,6 +6,9 @@ on: - main workflow_dispatch: +permissions: + packages: write + jobs: clang-format-check: runs-on: ubuntu-latest @@ -27,6 +30,11 @@ jobs: build-linux: runs-on: ubuntu-latest + env: + USERNAME: asfernandes + VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg + FEED_URL: https://nuget.pkg.github.com/asfernandes/index.json + VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/asfernandes/index.json,readwrite" steps: - name: Checkout repository uses: actions/checkout@v4 @@ -34,18 +42,6 @@ jobs: submodules: recursive fetch-depth: 0 - - name: Cache vcpkg artifacts - uses: actions/cache@v4 - with: - path: | - vcpkg/downloads - vcpkg/buildtrees - vcpkg/packages - build/Release/vcpkg_installed - key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} - restore-keys: | - ${{ runner.os }}-vcpkg- - - name: Install system dependencies run: | sudo apt-get update @@ -59,7 +55,8 @@ jobs: graphviz \ ninja-build \ libtommath1 \ - libtomcrypt1 + libtomcrypt1 \ + mono-complete - name: Install Firebird run: | @@ -79,6 +76,20 @@ jobs: run: | ./vcpkg/bootstrap-vcpkg.sh -disableMetrics + - name: Configure vcpkg binary caching + if: github.repository == 'asfernandes/fb-cpp' + run: | + mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ + sources add \ + -Source "${{ env.FEED_URL }}" \ + -StorePasswordInClearText \ + -Name GitHubPackages \ + -UserName "${{ env.USERNAME }}" \ + -Password "${{ secrets.GITHUB_TOKEN }}" + mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ + setapikey "${{ secrets.GITHUB_TOKEN }}" \ + -Source "${{ env.FEED_URL }}" + - name: Configure CMake run: | cp CMakeUserPresets.json.posix.template CMakeUserPresets.json @@ -106,6 +117,11 @@ jobs: build-windows: runs-on: windows-latest + env: + USERNAME: asfernandes + VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg + FEED_URL: https://nuget.pkg.github.com/asfernandes/index.json + VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/asfernandes/index.json,readwrite" steps: - name: Checkout repository uses: actions/checkout@v4 @@ -113,18 +129,6 @@ jobs: submodules: recursive fetch-depth: 0 - - name: Cache vcpkg artifacts - uses: actions/cache@v4 - with: - path: | - vcpkg/downloads - vcpkg/buildtrees - vcpkg/packages - build/vcpkg_installed - key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} - restore-keys: | - ${{ runner.os }}-vcpkg- - - name: Install Firebird shell: cmd run: | @@ -150,6 +154,21 @@ jobs: run: | vcpkg\bootstrap-vcpkg.bat -disableMetrics + - name: Configure vcpkg binary caching + if: github.repository == 'asfernandes/fb-cpp' + shell: pwsh + run: | + .$(${{ env.VCPKG_EXE }} fetch nuget) ` + sources add ` + -Source "${{ env.FEED_URL }}" ` + -StorePasswordInClearText ` + -Name GitHubPackages ` + -UserName "${{ env.USERNAME }}" ` + -Password "${{ secrets.GITHUB_TOKEN }}" + .$(${{ env.VCPKG_EXE }} fetch nuget) ` + setapikey "${{ secrets.GITHUB_TOKEN }}" ` + -Source "${{ env.FEED_URL }}" + - name: Configure CMake shell: cmd run: | @@ -178,6 +197,11 @@ jobs: build-macos: runs-on: macos-latest + env: + USERNAME: asfernandes + VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg + FEED_URL: https://nuget.pkg.github.com/asfernandes/index.json + VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/asfernandes/index.json,readwrite" steps: - name: Checkout repository uses: actions/checkout@v4 @@ -185,25 +209,14 @@ jobs: submodules: recursive fetch-depth: 0 - - name: Cache vcpkg artifacts - uses: actions/cache@v4 - with: - path: | - vcpkg/downloads - vcpkg/buildtrees - vcpkg/packages - build/Release/vcpkg_installed - key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} - restore-keys: | - ${{ runner.os }}-vcpkg- - - name: Install system dependencies run: | brew install \ autoconf \ autoconf-archive \ automake \ - libtool + libtool \ + mono - name: Install Firebird run: | @@ -222,6 +235,20 @@ jobs: run: | ./vcpkg/bootstrap-vcpkg.sh -disableMetrics + - name: Configure vcpkg binary caching + if: github.repository == 'asfernandes/fb-cpp' + run: | + mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ + sources add \ + -Source "${{ env.FEED_URL }}" \ + -StorePasswordInClearText \ + -Name GitHubPackages \ + -UserName "${{ env.USERNAME }}" \ + -Password "${{ secrets.GITHUB_TOKEN }}" + mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ + setapikey "${{ secrets.GITHUB_TOKEN }}" \ + -Source "${{ env.FEED_URL }}" + - name: Configure CMake run: | cp CMakeUserPresets.json.posix.template CMakeUserPresets.json