From a561591063b3b53ec05c20499dceb7e42ffa96dd Mon Sep 17 00:00:00 2001 From: AZMCode Date: Wed, 19 Aug 2020 15:33:51 -0400 Subject: [PATCH 01/14] Another update --- .github/workflows/main.yml | 63 +++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 445e547..34fcb98 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,38 +11,49 @@ jobs: - name: Parsing Package Info id: packageInfo + run: | + echo "::set-output name=package-name::$(jq -r .name package.json)" + echo "::set-output name=package-version::$(jq -r .version package.json)" + echo "::set-output name=commit-msg::$(git log -1 --pretty=%B)" + - name: Setup Node.js environment uses: actions/setup-node@v2.1.1 - with: - # Set always-auth in npmrc - always-auth: false - # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0 - node-version: 12.x - # Set this option if you want the action to check for the latest available version that satisfies the version spec - check-latest: true - # Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN - registry-url: false - # Optional scope for authenticating against scoped registries - scope: false - - name: Upload a Build Artifact - uses: actions/upload-artifact@v2.1.4 - name: Install Dependencies run: npm install - name: Build run: npm run build:all + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v2.1.4 + with: + name: baileysBuilt + path: | + docs/**/* + lib/**/* + package.json Publish-Docs: if: github.ref == 'refs/heads/master' && github.event_name == 'push' runs-on: ubuntu-latest needs: Build - + steps: + + - name: Download Build Artifact + uses: actions/download-artifact@v2.0.5 + with: + # Artifact name + name: baileysBuilt + # Destination path + path: ${{ github.workspace }} + - name: Publish to Pages uses: crazy-max/ghaction-github-pages@v2 with: target_branch: gh-pages + if-no-files-found: error build_dir: docs env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -52,8 +63,15 @@ jobs: if: github.ref == 'refs/heads/master' && github.event_name == 'push' needs: Build steps: - - name: Download the Build Artifact + - name: Download Build Artifact uses: actions/download-artifact@v2.0.5 + with: + name: baileysBuilt + path: ${{ github.workspace }} + + - name: Setup Node.js environment + uses: actions/setup-node@v2.1.1 + - name: Create Release id: releaseCreate continue-on-error: true @@ -62,11 +80,11 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: # The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag - tag_name: v${{ steps.packageInfo.outputs.package-version }} + tag_name: v${{ needs.Build.outputs.package-version }} # The name of the release. For example, `Release v1.0.1` - release_name: v${{steps.packageInfo.outputs.package-version}} + release_name: v${{needs.Build.outputs.package-version}} # Text describing the contents of the tag. - body: ${{steps.packageInfo.outputs.commit-msg}} + body: ${{needs.Build.outputs.commit-msg}} # `true` to create a draft (unpublished) release, `false` to create a published one. Default: `false` draft: false # `true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false` @@ -74,7 +92,10 @@ jobs: - name: Pack run: npm pack - + + - name: Rename Pack + run: mv *.tgz npmPackage.tgz + - name: Upload Package to Release continue-on-error: true uses: actions/upload-release-asset@v1.0.2 @@ -84,8 +105,8 @@ jobs: # The URL for uploading assets to the release upload_url: ${{steps.releaseCreate.outputs.upload_url}} # The path to the asset you want to upload - asset_path: ${{github.workspace}}/${{steps.packageInfo.outputs.package-scope}}-${{steps.packageInfo.outputs.package-name}}-${{steps.packageInfo.outputs.package-version}}.tgz - asset_name: NPM-Package-${{steps.packageInfo.outputs.package-name}}-${{steps.packageInfo.outputs.package-version}}.tgz + asset_path: npmPackage.tgz + asset_name: npmPackage.tgz # The content-type of the asset you want to upload. See the supported Media Types here: https://www.iana.org/assignments/media-types/media-types.xhtml for more information asset_content_type: application/x-compressed-tar - name: NPM Publish From a9036befd2543c16b6a820251a29032da1e90646 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sat, 29 Aug 2020 11:26:57 -0400 Subject: [PATCH 02/14] Remove push event. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8702732..b8382b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ name: CI -on: ["push"] + jobs: # Test: From 52e7ada5b08dfc563d0075f5a58524dcbb131dad Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sat, 29 Aug 2020 11:27:57 -0400 Subject: [PATCH 03/14] Removed non-necessary if statement. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b8382b4..4efcc25 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,7 +85,7 @@ jobs: Publish-Package: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' && github.event_name == 'push' + if: github.ref == 'refs/heads/master' needs: Build steps: - name: Download Build Artifact From 6c6da6de8b47b7efc2a5242403c3108b403ef438 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sat, 29 Aug 2020 11:32:41 -0400 Subject: [PATCH 04/14] Hopefully functional --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4efcc25..8dc8599 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,6 @@ name: CI +on: workflow_dispatch jobs: From 4ff21415fa885d6170edd49e7254c8d1a6feb4d4 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 08:55:47 -0400 Subject: [PATCH 05/14] Fix for unexpected trigger --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 44982c6..3b1b001 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ name: CI -on: ["push"] +on: "workflow_dispatch " jobs: # Test: From cc45e5f43e4558bf50cd6dbe72e0fe9020693891 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 08:59:48 -0400 Subject: [PATCH 06/14] A single space character --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b1b001..f1bace7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ name: CI -on: "workflow_dispatch " +on: "workflow_dispatch" jobs: # Test: From f896c1dffe72261daffff525805067ddbe6bab36 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 09:08:31 -0400 Subject: [PATCH 07/14] Debug Commit --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f1bace7..6e5dfb0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,6 +87,10 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v2.1.1 + + - name: Debug Release Creation + run: "echo ${{ toJson(needs) }}" + - name: Create Release id: releaseCreate continue-on-error: true From 96aaa4f25286b842ddf8511113bc8a6c43d225d6 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 09:20:59 -0400 Subject: [PATCH 08/14] Deleted duplicate upload and added debug echo --- .github/workflows/main.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5acae7..03d3118 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,15 +51,6 @@ jobs: lib/**/* package.json - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v2.1.4 - with: - name: baileysBuilt - path: | - docs/**/* - lib/**/* - package.json Publish-Docs: if: github.ref == 'refs/heads/master' && github.event_name == 'push' @@ -100,7 +91,7 @@ jobs: - name: Debug Release Creation - run: "echo ${{ toJson(needs) }}" + run: echo "${{ toJson(needs) }}" - name: Create Release id: releaseCreate From 4d98739bea1fd0ac0bf2c9be93619153f2e77802 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 09:30:29 -0400 Subject: [PATCH 09/14] Deleted unnecesary Publish-Docs restriction --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03d3118..df20626 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,7 +53,7 @@ jobs: Publish-Docs: - if: github.ref == 'refs/heads/master' && github.event_name == 'push' + if: github.ref != 'refs/heads/master' runs-on: ubuntu-latest needs: Build From a619d2f61dc1d81b0708c1c748868978263bc3cb Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 09:35:00 -0400 Subject: [PATCH 10/14] Mapped step outputs to Job outputs --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index df20626..2ce43c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,10 @@ jobs: # run: npm run test Build: runs-on: ubuntu-latest + outputs: + package-name: ${{ steps.packageInfo.package-name }} + package-version: ${{ steps.packageInfo.package-version }} + commit-msg: ${{ steps.packageInfo.package-name }} # Steps represent a sequence of tasks that will be executed as part of the job steps: - name: Checkout Commit From 258c514bfa50bf0eefc7646a935ab2d619baa7e9 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 09:40:37 -0400 Subject: [PATCH 11/14] Fixed dot path to step outputs --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2ce43c8..08068e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,9 +22,9 @@ jobs: Build: runs-on: ubuntu-latest outputs: - package-name: ${{ steps.packageInfo.package-name }} - package-version: ${{ steps.packageInfo.package-version }} - commit-msg: ${{ steps.packageInfo.package-name }} + package-name: ${{ steps.packageInfo.outputs.package-name }} + package-version: ${{ steps.packageInfo.outputs.package-version }} + commit-msg: ${{ steps.packageInfo.outputs.package-name }} # Steps represent a sequence of tasks that will be executed as part of the job steps: - name: Checkout Commit From b6de4901302474087ccdbc7deff2ee42a5943774 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 09:43:17 -0400 Subject: [PATCH 12/14] Possibly Final Commit --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08068e4..a31e8c5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: outputs: package-name: ${{ steps.packageInfo.outputs.package-name }} package-version: ${{ steps.packageInfo.outputs.package-version }} - commit-msg: ${{ steps.packageInfo.outputs.package-name }} + commit-msg: ${{ steps.packageInfo.outputs.commit-msg }} # Steps represent a sequence of tasks that will be executed as part of the job steps: - name: Checkout Commit From 967cf013a97ac0a53c935d1d6e91cee5b28d2cd2 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 09:45:19 -0400 Subject: [PATCH 13/14] Deleted continue-on-error on all steps --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a31e8c5..6ebe8d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,7 +99,6 @@ jobs: - name: Create Release id: releaseCreate - continue-on-error: true uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -122,7 +121,6 @@ jobs: run: mv *.tgz npmPackage.tgz - name: Upload Package to Release - continue-on-error: true uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 974927c9f41d53fdd3103c69035868fd3d350920 Mon Sep 17 00:00:00 2001 From: AZMCode Date: Sun, 30 Aug 2020 09:47:38 -0400 Subject: [PATCH 14/14] Fixed start condition --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ebe8d1..8035aac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,7 +57,7 @@ jobs: Publish-Docs: - if: github.ref != 'refs/heads/master' + if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest needs: Build