-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (136 loc) · 5.46 KB
/
actions.yaml
File metadata and controls
139 lines (136 loc) · 5.46 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: actions
on:
push:
paths-ignore:
- README.md
- LICENSE.md
- ATTRIBUTIONS.md
- '.github/workflows/codeql-analysis.yaml'
- '.github/dependabot.yaml'
- '.gitignore'
branches:
- root
pull_request:
paths-ignore:
- README.md
- LICENSE.md
- ATTRIBUTIONS.md
- '.github/workflows/codeql-analysis.yaml'
- '.github/dependabot.yaml'
- '.gitignore'
workflow_dispatch:
permissions:
contents: write
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: test
runs-on: ${{ matrix.os }}
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: '1.22.6'
- run: Get-ChildItem -Force
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
- name: Run action
uses: ./
id: jjversion
- name: Display jjversion outputs
run: |
echo "Major: ${{ steps.jjversion.outputs.major }}"
echo "Minor: ${{ steps.jjversion.outputs.minor }}"
echo "Patch: ${{ steps.jjversion.outputs.patch }}"
echo "MajorMinorPatch: ${{ steps.jjversion.outputs.majorMinorPatch }}"
echo "Sha: ${{ steps.jjversion.outputs.sha }}"
echo "ShortSha: ${{ steps.jjversion.outputs.shortSha }}"
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: '1.22.6'
- run: git log --oneline
- name: Run action
uses: ./
with:
skip-go-installation: true
id: jjversion
- run: echo "VERSION=$(echo ${{ steps.jjversion.outputs.majorMinorPatch }})" >> $GITHUB_ENV
- run: git reset --soft HEAD~1
- name: Run action for previous commit version
uses: ./
with:
skip-go-installation: true
id: previousversion
- run: echo "PREVIOUS_COMMIT_VERSION=$(echo ${{ steps.previousversion.outputs.majorMinorPatch }})" >> $GITHUB_ENV
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: jjliggett/jjversion
ref: 8d5c529715bc9d90834e0bd1a7ec472181eaf05f
path: jjversion-core
clean: false
- run: ls -R
- run: go build -a -v -o jjversion-ghao-${{ env.VERSION }}-linux-x64/jjversion-ghao
- run: env GOOS=darwin GOARCH=amd64 go build -a -v -o jjversion-ghao-${{ env.VERSION }}-darwin-amd64/jjversion-ghao-darwin
- run: env GOOS=windows GOARCH=amd64 go build -a -v -o jjversion-ghao-${{ env.VERSION }}-windows-x64/jjversion-ghao.exe
- run: mkdir docs-and-licenses
- run: cp README.md docs-and-licenses
- run: cp LICENSE.md docs-and-licenses
- run: cp ATTRIBUTIONS.md docs-and-licenses
- run: cp jjversion-core/README.md docs-and-licenses/jjversion-core-README.md
- run: cp jjversion-core/LICENSE.md docs-and-licenses/jjversion-core-LICENSE.md
- run: cp jjversion-core/docs/ATTRIBUTIONS.md docs-and-licenses/jjversion-core-ATTRIBUTIONS.md
- run: mkdir docs-and-licenses/attributions
- run: cp -R jjversion-core/docs/attributions/. docs-and-licenses/attributions
- run: zip -r jjversion-ghao-docs-and-licenses-${{ env.VERSION }}.zip docs-and-licenses
- run: ls -R
- name: Upload jjversion-ghao
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jjversion-ghao
path: jjversion-ghao-${{ env.VERSION }}-linux-x64/jjversion-ghao
- name: Upload jjversion-ghao-darwin
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jjversion-ghao-darwin
path: jjversion-ghao-${{ env.VERSION }}-darwin-amd64/jjversion-ghao-darwin
- name: Upload jjversion-ghao-darwin
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jjversion-ghao.exe
path: jjversion-ghao-${{ env.VERSION }}-windows-x64/jjversion-ghao.exe
- name: Upload docs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jjversion-ghao-docs-and-licenses-${{ env.VERSION }}.zip
path: jjversion-ghao-docs-and-licenses-${{ env.VERSION }}.zip
- name: Create GitHub release
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
if: ${{ github.ref == 'refs/heads/root' && env.VERSION != env.PREVIOUS_COMMIT_VERSION }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v${{ env.VERSION }}
draft: false
prerelease: false
generate_release_notes: true
make_latest: true
files: |
jjversion-ghao-${{ env.VERSION }}-linux-x64/jjversion-ghao
jjversion-ghao-${{ env.VERSION }}-darwin-amd64/jjversion-ghao-darwin
jjversion-ghao-${{ env.VERSION }}-windows-x64/jjversion-ghao.exe
README.md
LICENSE.md
jjversion-ghao-docs-and-licenses-${{ env.VERSION }}.zip