Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get-tag job to release worklflow #26

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,42 @@
name: Release
on:
workflow_call:
inputs:
tag:
type: string
required: true
secrets:
token:
required: true
jobs:
get-tag:
name: Get tag
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.get-tag-step.outputs.tag }}
steps:
- name: Get tag
run: |
branch=${{github.event.workflow_run.head_branch}}
echo tag=${branch#release/} >> $GITHUB_OUTPUT
id: get-tag-step

create-release:
name: Create release
needs: get-tag
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: refs/heads/${{github.event.workflow_run.head_branch}}
- name: Push tag ${{ inputs.tag }}
- name: Push tag ${{ needs.get-tag.outputs.tag }}
run: |
git status
git tag ${{ inputs.tag }}
git push origin ${{ inputs.tag }} -f
- name: Create release ${{ inputs.tag }}
git tag ${{ needs.get-tag.outputs.tag }}
git push origin ${{ needs.get-tag.outputs.tag }} -f
- name: Create release ${{ needs.get-tag.outputs.tag }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.token }}
with:
tag_name: refs/tags/${{ inputs.tag }}
release_name: ${{ inputs.tag }}
tag_name: refs/tags/${{ needs.get-tag.outputs.tag }}
release_name: ${{ needs.get-tag.outputs.tag }}
draft: false
prerelease: false