-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (153 loc) · 5.97 KB
/
actions.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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:
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@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- run: Get-ChildItem -Force
- 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 }}"
test-skip-input:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: test-skip-input
runs-on: ${{ matrix.os }}
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- run: Get-ChildItem -Force
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
- name: Run action
uses: ./
with:
skip-go-installation: true
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@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- 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@b4ffde65f46336ab88eb53be808477a3936bae11
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: jjversion-ghao
path: jjversion-ghao-${{ env.VERSION }}-linux-x64/jjversion-ghao
- name: Upload jjversion-ghao-darwin
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: jjversion-ghao-darwin
path: jjversion-ghao-${{ env.VERSION }}-darwin-amd64/jjversion-ghao-darwin
- name: Upload jjversion-ghao-darwin
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: jjversion-ghao.exe
path: jjversion-ghao-${{ env.VERSION }}-windows-x64/jjversion-ghao.exe
- name: Upload docs
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: jjversion-ghao-docs-and-licenses-${{ env.VERSION }}.zip
path: jjversion-ghao-docs-and-licenses-${{ env.VERSION }}.zip
- name: Create GitHub release
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0
if: ${{ github.ref == 'refs/heads/root' && env.VERSION != env.PREVIOUS_COMMIT_VERSION }}
with:
repo_token: ${{ secrets.RELEASES_TOKEN }}
automatic_release_tag: v${{ env.VERSION }}
prerelease: false
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