diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..b37c7e6 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,73 @@ +name-template: 'v$RESOLVED_VERSION ๐ŸŒˆ' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: '๐Ÿš€ Features' + labels: + - 'feature' + - title: '๐Ÿ’ช Enhancement' + labels: + - 'enhancement' + - title: '๐Ÿ› Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '๐Ÿงฐ Maintenance' + label: 'chore' + - title: '๐Ÿ”ง Refactoring' + label: 'refactor' + - title: '๐Ÿ“– Documentation' + label: 'documentation' + - title: 'โ›“๏ธ Dependency update' + label: 'dependencies' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + major: + labels: + - 'major' + minor: + labels: + - 'minor' + patch: + labels: + - 'patch' + default: patch +template: | + ## Changes + + $CHANGES +autolabeler: + - label: feature + branch: + - '/^feat(ure)?[/-].+/' + title: + - '/^feat(ure)?[/-].+/' + - label: bug + branch: + - '/^fix[/-].+/' + title: + - '/^fix[/-].+/' + - label: chore + branch: + - '/^chore[/-].+/' + title: + - '/^chore[/-].+/' + - label: refactor + branch: + - '/(refactor|refactoring)[/-].+/' + title: + - '/(refactor|refactoring)[/-].+/' + - label: documentation + branch: + - '/doc(umentation)[/-].+/' + title: + - '/doc(umentation)[/-].+/' + files: + - '*.md' + - label: enhancement + branch: + - '/(enhancement|improve)[/-].+/' + - label: github + files: + - '.github/**/*' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f0de4da --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,51 @@ +name: Publish + +on: + release: + types: + - published + +jobs: + build: + name: Release build + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '5.4' + +# - name: Setup PHP +# uses: shivammathur/setup-php@v2 +# with: +# php-version: '7.4' +# +# - name: Get composer cache directory +# id: composer-cache +# run: echo "::set-output name=dir::$(composer config cache-files-dir)" +# +# - name: Cache dependencies +# uses: actions/cache@v2 +# with: +# path: ${{ steps.composer-cache.outputs.dir }} +# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} +# restore-keys: ${{ runner.os }}-composer- +# +# - name: Install dependencies +# run: composer install --no-interaction --no-progress --prefer-dist + + - name: Download latest phar-composer.phar + run: composer run-script download-phar-composer + + - name: Build phar + run: composer run-script build + + - name: Upload Release Asset + uses: shogo82148/actions-upload-release-asset@v1 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: rocket.phar diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..c6cc343 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,45 @@ +name: Release Drafter + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - main + # pull_request event is required only for autolabeler + pull_request: + # Only following types are handled by the action, but one can default to all as well + types: [opened, reopened, synchronize] + # pull_request_target event is required for autolabeler to support PRs from forks + # pull_request_target: + # types: [opened, reopened, synchronize] + +permissions: + contents: read + +jobs: + release_draft: + name: Release draft + runs-on: ubuntu-latest + permissions: + contents: write # for release-drafter/release-drafter to create a github release + pull-requests: write # for release-drafter/release-drafter to add label to PR + outputs: + name: ${{ steps.release_drafter.outputs.name }} + tag_name: ${{ steps.release_drafter.outputs.tag_name }} + body: ${{ steps.release_drafter.outputs.body }} + upload_url: ${{ steps.release_drafter.outputs.upload_url }} + steps: + # (Optional) GitHub Enterprise requires GHE_HOST variable set + #- name: Set GHE_HOST + # run: | + # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV + + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + id: release_drafter + # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml + # with: + # config-name: my-config.yml + # disable-autolabeler: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index d18ef7e..54a4682 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,8 @@ composer.phar # composer.lock ### -/dist/ + +composer.lock +/build/ +phar-composer.phar +rocket.phar diff --git a/README.md b/README.md index ed57bc5..d0fb524 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,15 @@ ## Installation ```bash -wget https://github.com/apple-x-co/rocket/releases/download/0.1.7/rocket.phar +wget https://github.com/apple-x-co/rocket/releases/latest/download/rocket.phar chmod u+x rocket.phar ./rocket.phar --init > ./rocket.json ``` -```bash -# slack notification test -./rocket.phar --config ./rocket.json --notify-test +## Information -# verify rocket.json -./rocket.phar --config ./rocket.json --verify +```bash +./rocket.phar --info #--no-color ``` ## Update @@ -29,6 +27,12 @@ chmod u+x rocket.phar ## Usage ```bash +# slack notification test +./rocket.phar --config ./rocket.json --notify-test + +# verify rocket.json +./rocket.phar --config ./rocket.json --verify + # dry run (default) ./rocket.phar --config ./rocket.json --sync dry @@ -44,11 +48,3 @@ chmod u+x rocket.phar # notify cat example.txt | ./rocket.phar --config ./rocket.json --notify ``` - -## Build phar file - -```bash -composer run-script build -``` - -โ€ป ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๅ†…ใฎๅ…จใฆใฎใƒ•ใ‚กใ‚คใƒซใŒๅœง็ธฎใ•ใ‚Œใพใ™ใ€‚่ณ‡ๆ ผๆƒ…ๅ ฑใƒ•ใ‚กใ‚คใƒซใชใฉใฏ้…็ฝฎใ—ใชใ„ใงใใ ใ•ใ„ใ€‚ diff --git a/bin/build.php b/bin/build.php new file mode 100644 index 0000000..4c42f36 --- /dev/null +++ b/bin/build.php @@ -0,0 +1,12 @@ +