From 17282b773d35e792b3001c8b97a8562695c60376 Mon Sep 17 00:00:00 2001 From: yhortuk <17699384+yhortuk@users.noreply.github.com> Date: Fri, 11 Aug 2023 18:54:54 +0300 Subject: [PATCH] feat: release pipeline --- .github/workflows/releases.yaml | 34 +++++++++++++++++++ .../workflows/{pipeline.yaml => tests.yaml} | 4 +-- box.json | 3 +- build/build.sh | 9 ++--- 4 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/releases.yaml rename .github/workflows/{pipeline.yaml => tests.yaml} (93%) diff --git a/.github/workflows/releases.yaml b/.github/workflows/releases.yaml new file mode 100644 index 0000000..10d9b32 --- /dev/null +++ b/.github/workflows/releases.yaml @@ -0,0 +1,34 @@ +name: Releases + +on: + workflow_dispatch: + inputs: + tag: + description: 'New tag name' + required: true + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run tag creation + run: git tag ${{ github.event.inputs.tag }} + - uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + - name: Run binary build + run: | + chmod +x ./build/build.sh + ./build/build.sh + chmod +x ./builds/unload-0.1.2-linux + chmod +x ./builds/unload-0.1.2-macos + ./builds/unload-0.1.2-linux --version + - uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.event.inputs.tag }} + fail_on_unmatched_files: true + draft: true + files: | + builds/unload-${{ github.event.inputs.tag }}-linux + builds/unload-${{ github.event.inputs.tag }}-macos diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/tests.yaml similarity index 93% rename from .github/workflows/pipeline.yaml rename to .github/workflows/tests.yaml index 274b340..5c64a6e 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/tests.yaml @@ -1,4 +1,4 @@ -name: Unload Pipeline +name: Tests on: push: @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.1 - run: | pip install aws-sam-cli pip install localstack diff --git a/box.json b/box.json index 1ca0632..30de3b2 100644 --- a/box.json +++ b/box.json @@ -7,8 +7,7 @@ "config", "cloudformation", "vendor", - "resources", - "layers" + "resources" ], "files": [ "composer.json" diff --git a/build/build.sh b/build/build.sh index 91d1239..10698e4 100755 --- a/build/build.sh +++ b/build/build.sh @@ -7,10 +7,7 @@ $SCRIPT_DIR/../unload app:build --build-version=$LATEST_TAG echo "Creating static binaries..." -mkdir -p $SCRIPT_DIR/../builds/linux -mkdir -p $SCRIPT_DIR/../builds/macos +cat $SCRIPT_DIR/linux.sfx $SCRIPT_DIR/../builds/unload > $SCRIPT_DIR/../builds/unload-$LATEST_TAG-linux +cat $SCRIPT_DIR/macos.sfx $SCRIPT_DIR/../builds/unload > $SCRIPT_DIR/../builds/unload-$LATEST_TAG-macos -cat $SCRIPT_DIR/linux.sfx $SCRIPT_DIR/../builds/unload > $SCRIPT_DIR/../builds/linux/unload -cat $SCRIPT_DIR/macos.sfx $SCRIPT_DIR/../builds/unload > $SCRIPT_DIR/../builds/macos/unload - -echo "Build complete!" \ No newline at end of file +echo "Build complete!"