-
Notifications
You must be signed in to change notification settings - Fork 44
50 lines (44 loc) · 1.52 KB
/
tag-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Tag Release
on:
workflow_dispatch:
inputs:
release_tag:
description: 'github tag to create [semvar]'
required: true
workflow_call:
inputs:
release_tag:
description: 'github tag to create [semvar]'
required: true
type: string
piwind_branch:
description: "Branch of piwind to apply tag [git ref]"
required: true
type: string
env:
PIWIND_BRANCH: ${{ inputs.piwind_branch == '' && github.ref_name || inputs.piwind_branch }}
jobs:
tag_release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: OasisLMF/OasisPiWind
ref: ${{ env.PIWIND_BRANCH }}
- name: Setup github user
run: |
git config -l | grep 'http\..*\.extraheader' | cut -d= -f1 | xargs -L1 git config --unset-all
git config --global user.email ${{ secrets.BUILD_GIT_EMAIL }}
git config --global user.name ${{ secrets.BUILD_GIT_USERNAME }}
git config --global pull.ff only
- name: Tag the repository
run: |
if [ $(git tag -l "${{ inputs.release_tag }}") ]; then
git tag -d ${{ inputs.release_tag }}
fi
git tag ${{ inputs.release_tag }}
#git push origin ${{ inputs.release_tag }}
git push https://token:[email protected]/OasisLMF/OasisPiWind.git tag ${{ inputs.release_tag }}
env:
BUILD_GIT_TOKEN: ${{ secrets.BUILD_GIT_TOKEN }}