Update README.md #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Perform Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b | |
- name: Extract version | |
id: extract_version | |
run: | | |
printf "::set-output name=%s::%s\n" tag_name "${GITHUB_REF#refs/tags/}" | |
- name: Publish Package | |
run: | | |
echo "Publishing package version ${{ steps.extract_version.outputs.tag_name }} for user ${GITHUB_ACTOR}..." | |
./gradlew -b subtitler/build.gradle -Pversion=${{ steps.extract_version.outputs.tag_name }} publish | |
env: | |
GITHUB_USERNAME: ${{ github.actor }} | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Build CLI Zip File | |
run: | | |
echo "Building distribution file for version ${{ steps.extract_version.outputs.tag_name }}..." | |
./gradlew -b subtitler-cli/build.gradle -Pversion=${{ steps.extract_version.outputs.tag_name }} distZip | |
mv subtitler-cli/build/distributions/subtitler-${{ steps.extract_version.outputs.tag_name }}.zip subtitler-cli.zip | |
shasum -a 256 subtitler-cli.zip > subtitler-cli.zip.sha256 | |
- name: Generate Release Notes | |
run: | | |
export PREVIOUS=$(git describe --tags $(git rev-list --tags --max-count=2) --abbrev=0 | tail -n1) | |
echo "Previous release was $PREVIOUS" | |
git log --pretty=format:"- %s" $PREVIOUS..HEAD > release_notes.txt | |
cat release_notes.txt | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
with: | |
files: | | |
subtitler-cli.zip | |
subtitler-cli.zip.sha256 | |
draft: false | |
prerelease: false | |
fail_on_unmatched_files: true | |
body_path: release_notes.txt | |
- name: Update Homebrew Tap | |
uses: mislav/bump-homebrew-formula-action@v1 | |
with: | |
formula-name: subtitler | |
formula-path: Formula/subtitler.rb | |
homebrew-tap: caseyscarborough/homebrew-subtitler | |
base-branch: master | |
download-url: https://github.com/caseyscarborough/subtitler/releases/download/${{ steps.extract_version.outputs.tag_name }}/subtitler-cli.zip | |
commit-message: | | |
{{formulaName}} {{version}} | |
env: | |
COMMITTER_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |