diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 2d38ad7..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Publish - -on: - release: - types: [published] - -permissions: - contents: write - pull-requests: write - -jobs: - publish-conan: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: Install Conan - run: pip install conan - - - name: Configure Conan - run: conan profile detect --force - - - name: Export package - run: conan export . --version=${{ github.event.release.tag_name }} - - - name: Upload to Conan Center - env: - CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USERNAME }} - CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }} - run: | - conan upload "wrapsplash-cpp/${{ github.event.release.tag_name }}" \ - --remote conancenter --confirm - - publish-vcpkg: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up vcpkg - uses: lukka/run-vcpkg@v11 - with: - vcpkgGitCommitId: ${{ vars.VCPKG_COMMIT_ID }} - - - name: Create vcpkg port - run: | - VERSION="${{ github.event.release.tag_name }}" - VERSION="${VERSION#v}" - PORT_DIR="vcpkg-port" - mkdir -p "$PORT_DIR" - - cat > "$PORT_DIR/vcpkg.json" << EOF - { - "name": "wrapsplash-cpp", - "version": "$VERSION", - "description": "A C++ wrapper for the Unsplash API", - "license": "MIT", - "supports": "!(uwp|arm)", - "dependencies": ["curl", "nlohmann-json", "openssl"] - } - EOF - - cat > "$PORT_DIR/portfile.cmake" << 'PORTFILE' - set(VCPKG_BUILD_TYPE release) - - vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO Sandeepv68/wrapsplash-cpp - REF ${{ github.event.release.tag_name }} - SHA512 0 - HEAD_REF master - ) - - vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DWRAPSLASH_BUILD_TESTS=OFF - -DWRAPSLASH_BUILD_EXAMPLES=OFF - ) - - vcpkg_cmake_install() - vcpkg_cmake_config_fixup(PACKAGE_NAME wrapsplash++ CONFIG_PATH lib/cmake/wrapsplash++) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") - vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") - PORTFILE - - - name: Submit PR to vcpkg - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - VERSION="${{ github.event.release.tag_name }}" - VERSION="${VERSION#v}" - BRANCH="auto/wrapsplash-cpp-${VERSION}" - - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - git clone https://x-access-token:${GH_TOKEN}@github.com/microsoft/vcpkg.git /tmp/vcpkg - cd /tmp/vcpkg - git checkout -b "$BRANCH" - - mkdir -p "ports/wrapsplash-cpp" - cp "${{ github.workspace }}/vcpkg-port/vcpkg.json" "ports/wrapsplash-cpp/" - cp "${{ github.workspace }}/vcpkg-port/portfile.cmake" "ports/wrapsplash-cpp/" - - git add "ports/wrapsplash-cpp/" - git commit -m "wrapsplash-cpp: update to $VERSION" - git push origin "$BRANCH" - - gh pr create \ - --repo microsoft/vcpkg \ - --title "wrapsplash-cpp: update to $VERSION" \ - --body "Updates wrapsplash-cpp to $VERSION. Release: ${{ github.event.release.html_url }}" \ - --base master \ - --head "$BRANCH"