diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b9953bd..9ff482e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,6 +22,9 @@ jobs: ref: ${{ github.head_ref }} fetch-depth: 0 + - name: Get commit SHA + run: echo "LATEST_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - name: Setup Node.js uses: actions/setup-node@v2 with: @@ -34,6 +37,7 @@ jobs: echo "${{ github.event.inputs.version }}" > dist/VERSION env: DRIBBBLISH_VERSION: ${{ github.event.inputs.version }} + COMMIT_HASH: ${{ env.LATEST_SHA }} - name: Zip Release working-directory: dist diff --git a/.github/workflows/webpack-test.yml b/.github/workflows/webpack-test.yml index 7c6db78..a561d5e 100644 --- a/.github/workflows/webpack-test.yml +++ b/.github/workflows/webpack-test.yml @@ -12,6 +12,9 @@ jobs: with: ref: ${{ github.head_ref }} + - name: Get commit SHA + run: echo "LATEST_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - name: Setup Node.js uses: actions/setup-node@v2 with: @@ -22,9 +25,11 @@ jobs: npm install npm run build echo "Dev" > dist/VERSION - + env: + COMMIT_HASH: ${{ env.LATEST_SHA }} + - name: Upload Artifact uses: actions/upload-artifact@v2 with: - name: DribbblishDynamic_vDev + name: DribbblishDynamic_vDev-${{ env.LATEST_SHA }} path: dist/** diff --git a/src/js/main.js b/src/js/main.js index 6cf3741..3be28a9 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -355,7 +355,7 @@ waitForElement(["#main"], () => { description: ` OS: ${capitalizeFirstLetter(Spicetify.Platform.PlatformData.os_name)} v${Spicetify.Platform.PlatformData.os_version} Spotify: v${Spicetify.Platform.PlatformData.event_sender_context_information?.client_version_string ?? Spicetify.Platform.PlatformData.client_version_triple} - Dribbblish: v${process.env.DRIBBBLISH_VERSION} + Dribbblish: v${process.env.DRIBBBLISH_VERSION}-${process.env.COMMIT_HASH} `, data: "Copy", onChange: (val) => { diff --git a/webpack.config.js b/webpack.config.js index 79ca00d..33c2a89 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -52,7 +52,8 @@ module.exports = { cleanAfterEveryBuildPatterns: ["*.LICENSE.txt"] }), new webpack.DefinePlugin({ - "process.env.DRIBBBLISH_VERSION": JSON.stringify(process.env.DRIBBBLISH_VERSION || "Dev") + "process.env.DRIBBBLISH_VERSION": JSON.stringify(process.env.DRIBBBLISH_VERSION || "Dev"), + "process.env.COMMIT_HASH": JSON.stringify(process.env.COMMIT_HASH || "local") }), new CopyPlugin({ patterns: [{ from: "src/assets", to: "assets" }]