From a86c0011fd537db474b3245b84de163e137130ce Mon Sep 17 00:00:00 2001 From: iphydf Date: Fri, 14 Feb 2025 17:38:04 +0000 Subject: [PATCH] chore: Add deploy job for single C file library. --- .github/scripts/cmake-osx | 1 - .github/workflows/deploy.yml | 33 ++++++++++++++++++++------------- other/docker/goblint/sodium.c | 11 +++++++++++ other/make_single_file | 11 ++++++----- 4 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.github/scripts/cmake-osx b/.github/scripts/cmake-osx index 1ee1e9bb6..7cf6edebe 100755 --- a/.github/scripts/cmake-osx +++ b/.github/scripts/cmake-osx @@ -9,7 +9,6 @@ brew update brew install \ libconfig \ - libsodium \ libvpx \ opus diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 81c057a29..4a11fbbf8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -60,6 +60,7 @@ jobs: with: name: toxcore-linux-${{ matrix.arch }} path: toxcore-linux-${{ matrix.arch }} + if-no-files-found: error - name: Get tag name for release file name if: contains(github.ref, 'refs/tags/v') id: get_version @@ -77,7 +78,6 @@ jobs: with: allowUpdates: true draft: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "${{ steps.get_version.outputs.release_tarball }},${{ steps.get_version.outputs.release_tarball }}.sha256" - name: Create tarball for nightly upload run: | @@ -93,7 +93,6 @@ jobs: omitNameDuringUpdate: true prerelease: true replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "toxcore-nightly-linux-${{ matrix.arch }}.tar.gz,toxcore-nightly-linux-${{ matrix.arch }}.tar.gz.sha256" build-macos: @@ -119,6 +118,7 @@ jobs: with: name: toxcore-macos-${{ matrix.arch }} path: toxcore-macos-${{ matrix.arch }} + if-no-files-found: error - name: Get tag name for release file name if: contains(github.ref, 'refs/tags/v') id: get_version @@ -136,7 +136,6 @@ jobs: with: allowUpdates: true draft: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "${{ steps.get_version.outputs.release_tarball }},${{ steps.get_version.outputs.release_tarball }}.sha256" - name: Create tarball for nightly upload run: | @@ -152,7 +151,6 @@ jobs: omitNameDuringUpdate: true prerelease: true replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "toxcore-nightly-macos-${{ matrix.arch }}.tar.gz,toxcore-nightly-macos-${{ matrix.arch }}.tar.gz.sha256" build-ios: @@ -178,6 +176,7 @@ jobs: with: name: toxcore-${{ matrix.target }} path: toxcore-${{ matrix.target }} + if-no-files-found: error - name: Get tag name for release file name if: contains(github.ref, 'refs/tags/v') id: get_version @@ -195,7 +194,6 @@ jobs: with: allowUpdates: true draft: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "${{ steps.get_version.outputs.release_tarball }},${{ steps.get_version.outputs.release_tarball }}.sha256" - name: Create tarball for nightly upload run: | @@ -211,7 +209,6 @@ jobs: omitNameDuringUpdate: true prerelease: true replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "toxcore-nightly-${{ matrix.target }}.tar.gz,toxcore-nightly-${{ matrix.target }}.tar.gz.sha256" build-xcode-framework: @@ -244,7 +241,8 @@ jobs: uses: actions/upload-artifact@v4 with: name: toxcore-xcframework - path: Tox.xcframework + path: other/deploy/apple/Tox.xcframework + if-no-files-found: error - name: Get tag name for release file name if: contains(github.ref, 'refs/tags/v') id: get_version @@ -262,7 +260,6 @@ jobs: with: allowUpdates: true draft: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "${{ steps.get_version.outputs.release_tarball }},${{ steps.get_version.outputs.release_tarball }}.sha256" - name: Create tarball for nightly upload run: | @@ -278,7 +275,6 @@ jobs: omitNameDuringUpdate: true prerelease: true replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "toxcore-nightly-xcframework.tar.gz,toxcore-nightly-xcframework.tar.gz.sha256" build-android: @@ -304,6 +300,7 @@ jobs: with: name: toxcore-android-${{ matrix.arch }} path: toxcore-android-${{ matrix.arch }} + if-no-files-found: error - name: Get tag name for release file name if: contains(github.ref, 'refs/tags/v') id: get_version @@ -321,7 +318,6 @@ jobs: with: allowUpdates: true draft: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "${{ steps.get_version.outputs.release_tarball }},${{ steps.get_version.outputs.release_tarball }}.sha256" - name: Create tarball for nightly upload run: | @@ -337,7 +333,6 @@ jobs: omitNameDuringUpdate: true prerelease: true replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "toxcore-nightly-android-${{ matrix.arch }}.tar.gz,toxcore-nightly-android-${{ matrix.arch }}.tar.gz.sha256" build-wasm: @@ -369,6 +364,7 @@ jobs: with: name: toxcore-wasm.tar path: toxcore-wasm.tar + if-no-files-found: error - name: Compress tarball run: gzip toxcore-wasm.tar - name: Get tag name for release file name @@ -387,7 +383,6 @@ jobs: with: allowUpdates: true draft: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "${{ steps.get_version.outputs.release_tarball }}" - name: Create tarball for nightly upload run: | @@ -402,5 +397,17 @@ jobs: omitNameDuringUpdate: true prerelease: true replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} artifacts: "toxcore-nightly-wasm.tar.gz" + + build-single-file: + name: Single file + needs: [update-nightly-tag] + uses: TokTok/ci-tools/.github/workflows/deploy-artifact.yml@master + with: + project-name: toxcore + artifact-source: toxcore-{av,core}.c + artifact-versioned: toxcore-$VERSION-{av,core}.c + build: single-file + run: | + other/make_single_file -av >toxcore-av.c + other/make_single_file -core >toxcore-core.c diff --git a/other/docker/goblint/sodium.c b/other/docker/goblint/sodium.c index eb70c2745..c0c45d481 100644 --- a/other/docker/goblint/sodium.c +++ b/other/docker/goblint/sodium.c @@ -98,6 +98,17 @@ int crypto_hash_sha512(unsigned char *out, const unsigned char *in, { return 0; } +int crypto_pwhash_scryptsalsa208sha256(unsigned char *const out, + unsigned long long outlen, + const char *const passwd, + unsigned long long passwdlen, + const unsigned char *const salt, + unsigned long long opslimit, + size_t memlimit) +{ + memset(out, 0, outlen); + return 0; +} void randombytes(unsigned char *const buf, const unsigned long long buf_len) { memset(buf, 0, buf_len); diff --git a/other/make_single_file b/other/make_single_file index 7487ca512..20905ce58 100755 --- a/other/make_single_file +++ b/other/make_single_file @@ -45,15 +45,16 @@ sub emit { } } +my @core = (, , , ); if (@ARGV and $ARGV[0] eq "-core") { shift @ARGV; - for my $fn (, , ) { - emit(abs_path $fn); - } + emit(abs_path $_) for @core; } else { - for my $fn (, , , , ) { - emit(abs_path $fn); + if (@ARGV and $ARGV[0] eq "-av") { + # Ignore -av, it's the default. + shift @ARGV; } + emit(abs_path $_) for (, @core); } emit(abs_path $_) for @ARGV;