Skip to content

Bump to v1.8.2

Bump to v1.8.2 #7

Workflow file for this run

# @format
name: Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Get pushed tag
run: echo "TAG=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Build and get file name
run: echo "ZIP_FILE=$(./script/build.sh $TAG)" >> $GITHUB_ENV
- name: Get release body
id: get_release_body
run: |
IFS=$'\n'
URL="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}"
latest_tag=$(curl --url "${URL}/releases/latest" | jq -r '.tag_name')
commits=($(curl --url "${URL}/compare/${latest_tag}...${GITHUB_SHA}" |
jq -r '.commits[] | [.commit.message, .sha, .author.login] | @tsv' |
while IFS=$'\t' read -r message sha author; do
echo "- ${message%\\n\\n*} (${sha} by @${author})"
done))
body=$(echo "${commits[*]:0:${#commits[@]}-1}" | sed ':a; N; $!ba; s/\n/%0A/g')
echo "::set-output name=body::$body"
- name: Create a release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ImagePaste ${{ env.TAG }}
body: ${{ steps.get_release_body.outputs.body }}
draft: true
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ZIP_FILE }}
asset_name: ${{ env.ZIP_FILE }}
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}