Skip to content

Commit dd32cac

Browse files
committed
[chore] fix release workflow [skip ci]
1 parent 51dd1dd commit dd32cac

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v2
18-
18+
1919
- name: Set release version
2020
run: |
2121
VERSION=${{ github.event.inputs.version }}
@@ -26,6 +26,14 @@ jobs:
2626
git config --global user.name "GitHub Action"
2727
git commit -a -m "Releasing version $VERSION"
2828
git push origin master
29+
git rev-parse HEAD > HEAD
30+
31+
- name: Upload files
32+
uses: actions/upload-artifact@v2
33+
with:
34+
name: artifacts
35+
path: |
36+
HEAD
2937
3038
build:
3139
name: Build
@@ -37,7 +45,19 @@ jobs:
3745
runs-on: ${{ matrix.os }}
3846

3947
steps:
40-
- uses: actions/checkout@v2
48+
- name: Download all artifacts
49+
uses: actions/download-artifact@v2
50+
51+
- name: Read HEAD ref
52+
id: head
53+
uses: juliangruber/read-file-action@v1
54+
with:
55+
path: artifacts/HEAD
56+
57+
- name: Check out repository
58+
uses: actions/checkout@v2
59+
with:
60+
ref: ${{ steps.head.outputs.content }}
4161

4262
- name: Set up Java
4363
uses: actions/setup-java@v2
@@ -84,9 +104,20 @@ jobs:
84104
needs: build
85105
runs-on: ubuntu-latest
86106
steps:
107+
# must read HEAD before checkout
108+
- name: Download build artifacts
109+
uses: actions/download-artifact@v2
110+
111+
- name: Read HEAD ref
112+
id: head
113+
uses: juliangruber/read-file-action@v1
114+
with:
115+
path: artifacts/HEAD
116+
87117
- name: Checkout
88118
uses: actions/checkout@v2
89119
with:
120+
ref: ${{ steps.head.outputs.content }}
90121
fetch-depth: 0
91122

92123
- name: Download build artifacts

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.3.0
1+
12.3.0-SNAPSHOT

0 commit comments

Comments
 (0)