|
13 | 13 | release:
|
14 | 14 | runs-on: ubuntu-latest
|
15 | 15 |
|
| 16 | + env: |
| 17 | + # See: https://github.com/fsaintjacques/semver-tool/releases |
| 18 | + SEMVER_TOOL_VERSION: 3.2.0 |
| 19 | + |
16 | 20 | steps:
|
17 | 21 | - name: Set environment variables
|
18 | 22 | run: |
|
|
21 | 25 | echo "TAG_SHORT_NAME=$TAG_SHORT_NAME" >> "$GITHUB_ENV"
|
22 | 26 | echo "ARCHIVE_PATH=${{ runner.temp }}/libraries-repository-engine_${TAG_SHORT_NAME}_Linux_64bit.tar.gz" >> "$GITHUB_ENV"
|
23 | 27 | echo "CHANGELOG_PATH=${{ runner.temp }}/CHANGELOG.md" >> "$GITHUB_ENV"
|
| 28 | + echo "SEMVER_TOOL_PATH=${{ runner.temp }}/semver" >> "$GITHUB_ENV" |
24 | 29 |
|
25 | 30 | - name: Checkout repository
|
26 | 31 | uses: actions/checkout@v2
|
@@ -58,20 +63,26 @@ jobs:
|
58 | 63 | case-insensitive-regex: true
|
59 | 64 | changelog-file-path: ${{ env.CHANGELOG_PATH }}
|
60 | 65 |
|
61 |
| - - name: Identify pre-releases |
| 66 | + - name: Download semver tool |
| 67 | + id: download-semver-tool |
| 68 | + uses: carlosperate/download-file-action@v1.0.3 |
| 69 | + with: |
| 70 | + file-url: https://github.com/fsaintjacques/semver-tool/archive/${{ env.SEMVER_TOOL_VERSION }}.zip |
| 71 | + location: ${{ runner.temp }}/semver-tool |
| 72 | + |
| 73 | + - name: Install semver tool |
| 74 | + run: | |
| 75 | + unzip \ |
| 76 | + -p \ |
| 77 | + "${{ steps.download-semver-tool.outputs.file-path }}" \ |
| 78 | + semver-tool-${{ env.SEMVER_TOOL_VERSION }}/src/semver > \ |
| 79 | + "${{ env.SEMVER_TOOL_PATH }}" |
| 80 | + chmod +x "${{ env.SEMVER_TOOL_PATH }}" |
| 81 | +
|
| 82 | + - name: Identify Prerelease |
62 | 83 | id: prerelease
|
63 |
| - env: |
64 |
| - # See: https://github.com/fsaintjacques/semver-tool/releases/latest |
65 |
| - TOOL_VERSION: 3.2.0 |
66 | 84 | run: |
|
67 |
| - INSTALL_PATH="${{ runner.temp }}/semver-tool" |
68 |
| - mkdir -p "$INSTALL_PATH" |
69 |
| - wget --quiet --directory-prefix="$INSTALL_PATH" https://github.com/fsaintjacques/semver-tool/archive/${{ env.TOOL_VERSION }}.zip |
70 |
| - unzip -p "${INSTALL_PATH}/${{ env.TOOL_VERSION }}.zip" semver-tool-${{ env.TOOL_VERSION }}/src/semver >"${INSTALL_PATH}/semver" |
71 |
| - chmod +x "${INSTALL_PATH}/semver" |
72 |
| - if [[ $("${INSTALL_PATH}/semver" get prerel "${{ env.TAG_SHORT_NAME }}") ]]; then |
73 |
| - echo "::set-output name=is-pre::true"; |
74 |
| - fi |
| 85 | + if [[ "$("${{ env.SEMVER_TOOL_PATH }}" get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "::set-output name=IS_PRE::true"; fi |
75 | 86 |
|
76 | 87 | - name: Create Release
|
77 | 88 | uses: ncipollo/release-action@v1
|
|
0 commit comments