Skip to content

Commit 0a50ce3

Browse files
authored
Merge pull request #2073 from FabianKramm/master
build: fix pipeline fixed version problems
2 parents f2c6928 + 0d7f615 commit 0a50ce3

6 files changed

Lines changed: 174 additions & 151 deletions

File tree

.github/workflows/npm.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
registry-url: https://registry.npmjs.org/
2020
- run: |
2121
npm install -g
22+
export RELEASE_VERSION=$(node index.js get-latest)
2223
npm run prepare
2324
devspace --version
2425
npm uninstall -g devspace
@@ -41,6 +42,8 @@ jobs:
4142
registry-url: https://registry.npmjs.org/
4243
- run: |
4344
npm install -g
45+
$releaseVersion = node index.js get-latest
46+
$env:RELEASE_VERSION = $releaseVersion
4447
npm run prepare
4548
devspace --version
4649
npm uninstall -g devspace

.github/workflows/release.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ jobs:
3030
with:
3131
node-version: 12
3232
registry-url: https://registry.npmjs.org/
33+
- id: get_version
34+
run: |
35+
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p')
36+
echo "::set-output name=release_version::$RELEASE_VERSION"
3337
- name: Cache node modules
3438
uses: actions/cache@v1
3539
with:
@@ -39,6 +43,7 @@ jobs:
3943
${{ runner.os }}-node-
4044
- name: Build UI
4145
env:
46+
VERSION: ${{ steps.get_version.outputs.release_version }}
4247
NPM_CONFIG_GLOBALCONFIG: "dist/npm/config/npmrc"
4348
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_DEVSPACE_REGISTRY_TOKEN }}
4449
CI: "false"
@@ -57,6 +62,10 @@ jobs:
5762
uses: actions/setup-go@v1
5863
with:
5964
go-version: 1.17
65+
- id: get_version
66+
run: |
67+
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p')
68+
echo "::set-output name=release_version::$RELEASE_VERSION"
6069
- name: install-go-bindata
6170
run: go get -u github.com/go-bindata/go-bindata/...
6271
env:
@@ -72,6 +81,7 @@ jobs:
7281
- name: Compile binaries
7382
run: ./hack/build-all.bash
7483
env:
84+
VERSION: ${{ steps.get_version.outputs.release_version }}
7585
GOPATH: /Users/runner/work/devspace/go
7686
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }}
7787
ANALYTICS_TOKEN: ${{ secrets.ANALYTICS_TOKEN }}
@@ -92,12 +102,17 @@ jobs:
92102
with:
93103
node-version: 12
94104
registry-url: https://registry.npmjs.org/
105+
- id: get_version
106+
run: |
107+
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p')
108+
echo "::set-output name=release_version::$RELEASE_VERSION"
95109
- run: |
96110
npm ci
97111
export NPM_TAG=$(node index.js get-tag)
98112
npm publish --tag $NPM_TAG
99113
working-directory: ./dist/npm
100114
env:
115+
RELEASE_VERSION: ${{ steps.get_version.outputs.release_version }}
101116
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
102117
publish-next-image:
103118
if: github.ref == 'refs/heads/master'
@@ -133,4 +148,4 @@ jobs:
133148
repository: devspacesh/devspace
134149
username: ${{ secrets.DOCKER_USERNAME }}
135150
password: ${{ secrets.DOCKER_PASSWORD }}
136-
build_args: RELEASE_VERSION=${{ steps.get_version.outputs.release_version }}
151+
build_args: RELEASE_VERSION=${{ steps.get_version.outputs.release_version }}

dist/npm/bin/devspace

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ if [ ! -f "$BINARY" ] || [ "$STAT" -lt 10000 ]; then
3535

3636
echo "Running: node $BASEDIR/$INDEX_FILE finish-install $BINDIR"
3737
/usr/bin/env node "$BASEDIR/$INDEX_FILE" finish-install $BINDIR;
38+
if [ $? -ne 0 ]; then
39+
exit 1
40+
fi
3841

3942
CMD_BIN=$(command -v cmd.exe)
4043

0 commit comments

Comments
 (0)