Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push all vcpkg archives in a single commit #13

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 37 additions & 34 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
- push
- pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_REPOSITORY: https://github.com/OpenMW/vcpkg.git
Expand Down Expand Up @@ -190,6 +186,35 @@ jobs:
name: vcpkg-x64-${{ matrix.image }}-${{ github.sha }}
path: ${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-${{ github.sha }}.7z

- name: Repackage binaries for symbol server
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }}
working-directory: ${{ github.workspace }}/openmw-deps/windows
run: .\Store-Symbols.ps1 ${{ github.workspace }}\intermediate

- name: Upload symbols to symbol server
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-3
if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }}
working-directory: ${{ github.workspace }}/openmw-deps/windows/SymStore
run: aws --endpoint-url https://rgw.ctrl-c.liu.se s3 sync --size-only --exclude * --include *.dl_ --include *.pd_ . s3://openmw-sym

push-dynamic:
needs:
- dynamic

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4

- name: Setup ssh-agent
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
Expand Down Expand Up @@ -244,31 +269,26 @@ jobs:
if: ${{ env.SSH_PRIVATE_KEY == '' }}
run: git clone https://gitlab.com/OpenMW/openmw-deps.git

- name: Move exported vcpkg packages to openmw-deps repository
run: mv vcpkg-x64-${{ matrix.image }}-${{ github.sha }}.7z openmw-deps/windows/

- name: Move pdb files archive to openmw-deps repository
run: mv vcpkg-x64-${{ matrix.image }}-pdb-${{ github.sha }}.7z openmw-deps/windows/
- name: Move exported vcpkg packages and pdb files archive to openmw-deps repository
run: mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-*-${{ github.sha }}.7z openmw-deps/windows/

- name: Generate commit message
shell: bash
env:
GH_TOKEN: ${{ github.token }}
working-directory: ${{ github.workspace }}/openmw-deps
run: |
echo Add ${{ matrix.image }} vcpkg packages built at ${{ github.sha }} > commit_message.txt
echo Add vcpkg packages built at ${{ github.sha }} > commit_message.txt
echo >> commit_message.txt
printf 'Generated by ' >> commit_message.txt
url=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "dynamic-${{ matrix.image }}") | .url')
printf 'Pushed by ' >> commit_message.txt
url=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "push-dynamic") | .url')
echo "${url:?}" >> commit_message.txt
echo >> commit_message.txt

- name: Commit exported vcpkg packages
working-directory: ${{ github.workspace }}/openmw-deps
run: |
git checkout -b vcpkg-x64-${{ matrix.image }}-${{ github.sha }}
git add windows/vcpkg-x64-${{ matrix.image }}-${{ github.sha }}.7z
git add windows/vcpkg-x64-${{ matrix.image }}-pdb-${{ github.sha }}.7z
git checkout -b vcpkg-x64-${{ github.sha }}
git add windows/vcpkg-x64-*-${{ github.sha }}.7z
git commit -F commit_message.txt

- name: Verify commit to openmw-deps repository
Expand All @@ -284,21 +304,4 @@ jobs:
working-directory: ${{ github.workspace }}/openmw-deps
run: |
git remote set-url --push origin "${{ vars.PUSH_URL }}"
git push origin vcpkg-x64-${{ matrix.image }}-${{ github.sha }}

- name: Repackage binaries for symbol server
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }}
working-directory: ${{ github.workspace }}/openmw-deps/windows
run: .\Store-Symbols.ps1 ${{ github.workspace }}\intermediate

- name: Upload symbols to symbol server
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-3
if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }}
working-directory: ${{ github.workspace }}/openmw-deps/windows/SymStore
run: aws --endpoint-url https://rgw.ctrl-c.liu.se s3 sync --size-only --exclude * --include *.dl_ --include *.pd_ . s3://openmw-sym
git push origin vcpkg-x64-${{ github.sha }}
Loading