This commit is contained in:
Minghe
2019-10-09 00:03:20 +08:00
committed by GitHub
parent d821b46744
commit 2e6ec2f8a2
2 changed files with 4 additions and 44 deletions

View File

@@ -1,40 +0,0 @@
name: release
on:
create:
tags:
- v*.*.*
jobs:
release:
runs-on: ubuntu-18.04
steps:
- name: checkout
uses: actions/checkout@v1
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
MINOR=${TAG%.*}
MAJOR=${MINOR%.*}
echo ::set-output name=tag_name::${TAG}
echo ::set-output name=minor_tag::${MINOR}
echo ::set-output name=major_tag::${MAJOR}
echo ::set-output name=major_exists::$(git show-ref origin/releases/${MAJOR})
- name: set up Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
- name: checkout releases/${{ steps.prepare.outputs.major_tag }} branch
run: |
git checkout -B releases/${{ steps.prepare.outputs.tag_name }}
git show --stat-count=10 HEAD
git push -f origin releases/${{ steps.prepare.outputs.tag_name }}
- name: update ${{ steps.prepare.outputs.minor_tag }} tag
run: |
git push origin :refs/tags/${{ steps.prepare.outputs.tag_name }}
git tag -fa ${{ steps.prepare.outputs.tag_name }} -m "Release ${{ steps.prepare.outputs.tag_name }}"
git push origin ${{ steps.prepare.outputs.tag_name }}

View File

@@ -1,12 +1,12 @@
name: releaser name: releaser
on: on:
pull_request:
branches:
- releases/*
push: push:
branches: branches:
- releases/* - production
create:
tags:
- v*.*.*
jobs: jobs:
ci: ci: