-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yaml
66 lines (66 loc) · 1.93 KB
/
action.yaml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
name: "Tagger - Move semantic tags!"
description: "Automatically move your semantic tags on release."
branding:
icon: tag
color: orange
inputs:
tag:
description: "The new tag. Other tags will be moved to this position."
required: true
default: ${{ github.ref }}
prefix:
description: "The prefix of the semantic tags."
required: true
default: ""
token:
description: "The github token."
required: true
default: ${{ github.token }}
runs:
using: "composite"
steps:
- name: Collect info
id: info
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
bin=$DIR\\tagger.exe
else
bin="$DIR/tagger"
fi
echo "BIN=$bin" >> $GITHUB_OUTPUT
shell: sh
env:
DIR: ${{ runner.temp }}
- name: Download tagger (Linux, macOS)
if: ${{ runner.os != 'Windows' }}
run: |
if [ "${{ runner.os }}" = "Linux" ]; then
suffix=linux
else
suffix=mac
fi
wget https://github.com/fischerscode/tagger/releases/download/v0.2.0/tagger.${suffix} -O ${{ steps.info.outputs.BIN }}
chmod +x ${{ steps.info.outputs.BIN }}
shell: sh
- name: Download tagger (Windows)
if: ${{ runner.os == 'Windows' }}
run: |
Invoke-WebRequest -URI https://github.com/fischerscode/tagger/releases/download/v0.2.0/tagger.windows.exe -OutFile $Env:BIN
echo "Saved to $Env:BIN"
shell: pwsh
env:
BIN: ${{ steps.info.outputs.BIN }}
- run: $BIN move -s -p '${{ inputs.prefix }}' ${INPUTS_TAG##*/}
shell: bash
env:
INPUTS_TAG: ${{ inputs.tag }}
BIN: ${{ steps.info.outputs.BIN }}
- run: rm $BIN
shell: sh
env:
BIN: ${{ steps.info.outputs.BIN }}
- run: |
repo=$(echo "${{ github.repositoryUrl }}" | sed "s,git://,https://${GITHUB_ACTOR}:${INPUT_TOKEN}@,")
git push "$repo" --tags --force
shell: sh