Skip to content

Commit

Permalink
Merge pull request #1008 from jumpserver/pr@v3.9@fix_actions_version
Browse files Browse the repository at this point in the history
fix: 修正 actions version 获取错误
  • Loading branch information
wojiushixiaobai committed Nov 17, 2023
2 parents 9217d84 + 1d245fb commit bfb6ef1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ jobs:
id: get_version
run: |
TAG=$(basename ${GITHUB_REF})
VERSION=${TAG/v/}
echo "::set-output name=TAG::$TAG"
echo "::set-output name=VERSION::$VERSION"
- name: Create Release
id: create_release
uses: release-drafter/release-drafter@v5
Expand All @@ -38,17 +36,17 @@ jobs:
run: yarn install
- name: Build web
run: |
sed -i "s@[0-9].[0-9].[0-9]@${{ steps.get_version.outputs.TAG }}@g" src/environments/environment.prod.ts
sed -i "s@version =.*;@version = '${{ steps.get_version.outputs.TAG }}';@g" src/environments/environment.prod.ts
yarn build
- name: Create Upload Assets
run: |
mkdir -p build
rm -rf build/*
cp -R src/assets/i18n luna/
mv luna luna-${{ steps.get_version.outputs.VERSION }}
tar -czf luna-${{ steps.get_version.outputs.VERSION }}.tar.gz luna-${{ steps.get_version.outputs.VERSION }}
echo $(md5sum luna-${{ steps.get_version.outputs.VERSION }}.tar.gz | awk '{print $1}') > build/luna-${{ steps.get_version.outputs.VERSION }}.tar.gz.md5
mv luna-${{ steps.get_version.outputs.VERSION }}.tar.gz build/
mv luna luna-${{ steps.get_version.outputs.TAG }}
tar -czf luna-${{ steps.get_version.outputs.TAG }}.tar.gz luna-${{ steps.get_version.outputs.TAG }}
echo $(md5sum luna-${{ steps.get_version.outputs.TAG }}.tar.gz | awk '{print $1}') > build/luna-${{ steps.get_version.outputs.TAG }}.tar.gz.md5
mv luna-${{ steps.get_version.outputs.TAG }}.tar.gz build/
- name: Release Upload Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ RUN set -ex \
&& npm config set registry ${NPM_REGISTRY} \
&& yarn config set registry ${NPM_REGISTRY}

ADD package.json yarn.lock /data
ADD package.json yarn.lock /data/
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=luna \
yarn install

ARG VERSION
ENV VERSION=$VERSION
ADD . /data
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=luna \
sed -i "s@[0-9].[0-9].[0-9]@${VERSION}@g" src/environments/environment.prod.ts \
sed -i "s@version =.*;@version = '${VERSION}';@g" src/environments/environment.prod.ts \
&& yarn build \
&& cp -R src/assets/i18n luna/

Expand Down

0 comments on commit bfb6ef1

Please sign in to comment.