Skip to content

Commit

Permalink
Add release job to CI (#4)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
szepeviktor authored Jan 10, 2021
1 parent 6c1b514 commit ad4a813
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ad4a813

Please sign in to comment.