From ad4a813b7f3d3b8d4ee9df6e0c287b0c78f0c38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sun, 10 Jan 2021 17:22:38 +0100 Subject: [PATCH] Add release job to CI (#4) * Add release job to CI * Rename .github/workflow/release.yml to .github/workflows/release.yml * Update release.yml * Update release.yml * Update release.yml * Update release.yml * Update release.yml --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..06835c4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: "Publish release" + +on: + push: + tags: + - "v*" + +jobs: + release: + name: "Publish release" + runs-on: "ubuntu-latest" + steps: + - name: "Checkout code" + uses: "actions/checkout@v2" + + - name: "Setup PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "7.1" + + - name: "Install dependencies" + run: "composer update --no-interaction --no-dev --prefer-dist" + + - name: "Determine tag" + id: "determine_git_tag" + shell: "bash" + run: echo "::set-output name=tag_name::${GITHUB_REF/refs\/tags\//}" + + - name: "Create directory structure" + run: | + mkdir wp-rest-api-auth0 + cp -r LICENSE README.md wp-rest-api-auth0.php vendor/ wp-rest-api-auth0/ + + - name: "Create ZIP file" + run: "zip -r -9 wp-rest-api-auth0.zip wp-rest-api-auth0-loader.php wp-rest-api-auth0/" + + - name: "Upload ZIP as release asset" + uses: "svenstaro/upload-release-action@v2" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + tag: "${{ github.ref }}" + file: "wp-rest-api-auth0.zip" + asset_name: "wp-rest-api-auth0-${{ steps.determine_git_tag.outputs.tag_name }}.zip" + overwrite: true