Skip to content

Commit

Permalink
Merge branch 'main' into user/mingxwa/weak-wording
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxwa authored Nov 22, 2024
2 parents fd8be4f + 68af9c8 commit d4cb574
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 71 deletions.
89 changes: 22 additions & 67 deletions .github/workflows/pipeline-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,102 +9,57 @@ on:
default: '0.0.0'

jobs:
prepare-release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: create release branch
run: |
git checkout -b release/${{ github.event.inputs.version }}
- name: assign cmake version
run: "((Get-Content -Path CMakeLists.txt -Raw) -Replace 'VERSION 0.1.0 # local build version','VERSION ${{ github.event.inputs.version }}') | Set-Content -Path CMakeLists.txt -NoNewLine"

- name: commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "release bot"
git add CMakeLists.txt
git commit -m 'assign a release version'
- name: new git tag
run: |
git tag ${{ github.event.inputs.version }}
- name: push git objects
run: |
git push origin release/${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}
run-bvt-gcc:
needs: prepare-release
name: Run BVT with GCC
uses: ./.github/workflows/bvt-gcc.yml
with:
branch: release/${{ github.event.inputs.version }}

run-bvt-clang:
needs: prepare-release
name: Run BVT with Clang
uses: ./.github/workflows/bvt-clang.yml
with:
branch: release/${{ github.event.inputs.version }}

run-bvt-msvc:
needs: prepare-release
name: Run BVT with MSVC
uses: ./.github/workflows/bvt-msvc.yml
with:
branch: release/${{ github.event.inputs.version }}

run-bvt-appleclang:
needs: prepare-release
name: Run BVT with AppleClang
uses: ./.github/workflows/bvt-appleclang.yml
with:
branch: release/${{ github.event.inputs.version }}

run-bvt-nvhpc:
needs: prepare-release
name: Run BVT with NVHPC
uses: ./.github/workflows/bvt-nvhpc.yml
with:
branch: release/${{ github.event.inputs.version }}

report:
uses: ./.github/workflows/bvt-report.yml
name: Generate report
needs: [run-bvt-gcc, run-bvt-clang, run-bvt-msvc, run-bvt-appleclang, run-bvt-nvhpc]

draft-release:
runs-on: windows-latest
name: Draft release
runs-on: ubuntu-24.04
needs: report
steps:
- uses: actions/checkout@v3
with:
ref: release/${{ github.event.inputs.version }}
- uses: actions/checkout@v4

- name: create zip archive
run: Compress-Archive -Path ".\proxy.h" -DestinationPath ".\proxy-${{ github.event.inputs.version }}.zip"
- name: create tag
run: |
git checkout -b release/${{ github.event.inputs.version }}
sed -i 's/VERSION 0\.1\.0 # local build version/VERSION ${{ github.event.inputs.version }}/' CMakeLists.txt
git config --local user.email "[email protected]"
git config --local user.name "release bot"
git add CMakeLists.txt
git commit -m "Release version ${{ github.event.inputs.version }}"
git tag ${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}
- uses: actions/create-release@v1
name: create release draft
id: release_draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Proxy ${{ github.event.inputs.version }} Release
draft: true
prerelease: true
- name: create tgz archive
run: tar -czf "proxy-${{ github.event.inputs.version }}.tgz" "proxy.h"

- name: upload artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: create release draft
uses: softprops/action-gh-release@v2
with:
upload_url: ${{ steps.release_draft.outputs.upload_url }}
asset_path: ./proxy-${{ github.event.inputs.version }}.zip
asset_name: proxy-${{ github.event.inputs.version }}.zip
asset_content_type: application/zip
draft: true
files: proxy-${{ github.event.inputs.version }}.tgz
name: Proxy ${{ github.event.inputs.version }} Release
tag_name: ${{ github.event.inputs.version }}
generate_release_notes: true
58 changes: 54 additions & 4 deletions proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -1466,14 +1466,30 @@ struct operator_dispatch;
operator __VA_ARGS__) \
};

#ifdef NDEBUG
#define ___PRO_DEF_RHS_OP_ACCESSOR(Q, NE, SELF, FW_SELF, ...) \
template <class F, class C, class R, class Arg> \
struct accessor<F, C, R(Arg) Q> { \
friend R operator __VA_ARGS__ (Arg arg, SELF) NE { \
return proxy_invoke<C, R(Arg) Q>( \
access_proxy<F>(FW_SELF), std::forward<Arg>(arg)); \
} \
}
#else
#define ___PRO_DEF_RHS_OP_ACCESSOR(Q, NE, SELF, FW_SELF, ...) \
template <class F, class C, class R, class Arg> \
struct accessor<F, C, R(Arg) Q> { \
friend R __VA_ARGS__ (Arg arg, SELF) NE { \
accessor() noexcept { std::ignore = &accessor::_symbol_guard; } \
friend R operator __VA_ARGS__ (Arg arg, SELF) NE { \
return proxy_invoke<C, R(Arg) Q>( \
access_proxy<F>(FW_SELF), std::forward<Arg>(arg)); \
} \
\
private: \
static inline R _symbol_guard(Arg arg, SELF) NE \
{ return std::forward<Arg>(arg) __VA_ARGS__ FW_SELF; } \
}
#endif // NDEBUG
#define ___PRO_RHS_OP_DISPATCH_IMPL(...) \
template <> \
struct operator_dispatch<#__VA_ARGS__, true> { \
Expand All @@ -1482,7 +1498,7 @@ struct operator_dispatch;
___PRO_DIRECT_FUNC_IMPL(std::forward<Arg>(arg) __VA_ARGS__ \
std::forward<T>(self)) \
___PRO_DEF_FREE_ACCESSOR_TEMPLATE(___PRO_DEF_RHS_OP_ACCESSOR, \
operator __VA_ARGS__) \
__VA_ARGS__) \
};

#define ___PRO_EXTENDED_BINARY_OP_DISPATCH_IMPL(...) \
Expand All @@ -1507,14 +1523,30 @@ struct operator_dispatch;
} \
} \
}
#ifdef NDEBUG
#define ___PRO_DEF_RHS_ASSIGNMENT_OP_ACCESSOR(Q, NE, SELF, FW_SELF, ...) \
template <class F, class C, class R, class Arg> \
struct accessor<F, C, R(Arg&) Q> { \
friend Arg& operator __VA_ARGS__ (Arg& arg, SELF) NE { \
proxy_invoke<C, R(Arg&) Q>(access_proxy<F>(FW_SELF), arg); \
return arg; \
} \
}
#else
#define ___PRO_DEF_RHS_ASSIGNMENT_OP_ACCESSOR(Q, NE, SELF, FW_SELF, ...) \
template <class F, class C, class R, class Arg> \
struct accessor<F, C, R(Arg&) Q> { \
friend Arg& __VA_ARGS__ (Arg& arg, SELF) NE { \
accessor() noexcept { std::ignore = &accessor::_symbol_guard; } \
friend Arg& operator __VA_ARGS__ (Arg& arg, SELF) NE { \
proxy_invoke<C, R(Arg&) Q>(access_proxy<F>(FW_SELF), arg); \
return arg; \
} \
\
private: \
static inline Arg& _symbol_guard(Arg& arg, SELF) NE \
{ return arg __VA_ARGS__ FW_SELF; } \
}
#endif // NDEBUG
#define ___PRO_ASSIGNMENT_OP_DISPATCH_IMPL(...) \
template <> \
struct operator_dispatch<#__VA_ARGS__, false> { \
Expand All @@ -1532,7 +1564,7 @@ struct operator_dispatch;
___PRO_DIRECT_FUNC_IMPL(std::forward<Arg>(arg) __VA_ARGS__ \
std::forward<T>(self)) \
___PRO_DEF_FREE_ACCESSOR_TEMPLATE(___PRO_DEF_RHS_ASSIGNMENT_OP_ACCESSOR, \
operator __VA_ARGS__) \
__VA_ARGS__) \
};

___PRO_EXTENDED_BINARY_OP_DISPATCH_IMPL(+)
Expand Down Expand Up @@ -1664,6 +1696,7 @@ struct conversion_dispatch {
#define PRO_DEF_MEM_DISPATCH(__NAME, ...) \
___PRO_EXPAND_MACRO(___PRO_DEF_MEM_DISPATCH, __NAME, __VA_ARGS__)

#ifdef NDEBUG
#define ___PRO_DEF_FREE_ACCESSOR(__Q, __NE, __SELF, __FW_SELF, ...) \
template <class __F, class __C, class __R, class... __Args> \
struct accessor<__F, __C, __R(__Args...) __Q> { \
Expand All @@ -1673,6 +1706,23 @@ struct conversion_dispatch {
::std::forward<__Args>(__args)...); \
} \
}
#else
#define ___PRO_DEF_FREE_ACCESSOR(__Q, __NE, __SELF, __FW_SELF, ...) \
template <class __F, class __C, class __R, class... __Args> \
struct accessor<__F, __C, __R(__Args...) __Q> { \
accessor() noexcept { ::std::ignore = &accessor::_symbol_guard; } \
friend __R __VA_ARGS__(__SELF, __Args... __args) __NE { \
return ::pro::proxy_invoke<__C, __R(__Args...) __Q>( \
::pro::access_proxy<__F>(__FW_SELF), \
::std::forward<__Args>(__args)...); \
} \
\
private: \
static inline __R _symbol_guard(__SELF, __Args... __args) __NE { \
return __VA_ARGS__(__FW_SELF, ::std::forward<__Args>(__args)...); \
} \
}
#endif // NDEBUG
#define ___PRO_DEF_FREE_DISPATCH_IMPL(__NAME, __FUNC, __FNAME) \
struct __NAME { \
template <class __T, class... __Args> \
Expand Down

0 comments on commit d4cb574

Please sign in to comment.