Skip to content

Commit

Permalink
Release binary via GA
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Jan 6, 2020
1 parent 5b59f98 commit e2c7f9d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@master

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Get changelog
id: changelog
shell: bash
run: |
bash ci/get_changelog.sh
bash ci/get_changelog.sh ${{ steps.get_version.outputs.VERSION }}
- name: Create Release
id: create_release
Expand Down Expand Up @@ -63,7 +67,7 @@ jobs:
asset_name: maple-macos-amd64

steps:
- uses: hecrj/setup-rust-action@v1-release
- uses: hecrj/setup-rust-action@master
with:
rust-version: stable

Expand Down
18 changes: 10 additions & 8 deletions ci/get_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
cd ..

# v0.3
cur_tag=$(git describe --abbrev=0 --tags)
prev_tag=$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)")
cur_tag=$1

# FIXME get prev_tag in GA
# prev_tag=$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)")

# 0.3
cur_header="[${cur_tag:1:8}]"
prev_header="[${prev_tag:1:8}]"
# cur_header="[${cur_tag:1:8}]"
# prev_header="[${prev_tag:1:8}]"

begin=$(grep -Fn "$cur_header" CHANGELOG.md | awk '{split($0,a,":"); print a[1]}')
# begin=$(grep -Fn "$cur_header" CHANGELOG.md | awk '{split($0,a,":"); print a[1]}')

end=$(grep -Fn "$prev_header" CHANGELOG.md | awk '{split($0,a,":"); print a[1]}')
end="$(("$end"-1))"
# end=$(grep -Fn "$prev_header" CHANGELOG.md | awk '{split($0,a,":"); print a[1]}')
# end="$(("$end"-1))"

sed -n "$begin","$end"p CHANGELOG.md
# sed -n "$begin","$end"p CHANGELOG.md

0 comments on commit e2c7f9d

Please sign in to comment.