0

I am using GitHub actions to create a release build when a tag gets pushed. However, once it runs and I check the releases tab it hasn’t created the release correctly. Normally when you run ng build --prod it compiles all of your code into a few files reducing the file size massively. When I download the project from the releases tab it’s just normal like I would view it in a file explorer.

This is my workflow yaml file:

name: dev-release

on:

  create:

    tags:

      - v*

jobs:

  build:

    name: setup environment

    runs-on: ubuntu-latest

    strategy:

      matrix:

        node-version: [12.x]

    steps:

      - uses: actions/checkout@v2

        with:

          fetch-depth: 0

      - name: Cache node modules

        uses: actions/[email protected]

        with:

          path: ~/.npm

          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

          restore-keys: |

            ${{ runner.os }}-node-

      - name: Node ${{ matrix.node-version }}

        uses: actions/[email protected]

        with:

          node-version: ${{ matrix.node-version }}

      - name: npm install

        run: |

          npm i

          npm run build:ci

      - name: Create Release

        uses: ncipollo/release-action@v1

        with:

          token: ${{ secrets.TOKEN }}

          draft: true
2
  • Can you add logs? Commented Nov 18, 2020 at 10:53
  • I think that the issue is that you didn't define artifacts in ncipollo/release-action@v1 so it publishes current dictionary. Commented Nov 18, 2020 at 11:26

1 Answer 1

1

Plese define artifacts in ncipollo/release-action@v1 to you folder as

artifacts: An optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs).

Looking at logs all seems to be fine because code was compiled:

2020-11-18T11:01:59.5831738Z chunk {} runtime.1d195ead05122679a08a.js (runtime) 2.3 kB [entry] [rendered]
2020-11-18T11:01:59.5832939Z chunk {1} 1.c16b36d40a2635ee97c6.js () 174 kB  [rendered]
2020-11-18T11:01:59.5833729Z chunk {2} 2.5449d2e89a98cbd134fb.js () 37.2 kB  [rendered]
2020-11-18T11:01:59.5834534Z chunk {3} 3.fe05023c0dd4c02292ef.js () 53.6 kB  [rendered]
2020-11-18T11:01:59.5835659Z chunk {4} light.blue.yale.a040718431090d476d1d.css (light.blue.yale) 168 kB [initial] [rendered]
2020-11-18T11:01:59.5836819Z chunk {5} main.38262ff03d42f24493fc.js (main) 1.32 MB [initial] [rendered]
2020-11-18T11:01:59.5837887Z chunk {6} polyfills.55cc3ce773551d941d32.js (polyfills) 36 kB [initial] [rendered]
2020-11-18T11:01:59.5839256Z chunk {7} styles.d3fcf7ce8fd057dbb140.css (styles) 305 kB [initial] [rendered]
2020-11-18T11:01:59.5840306Z chunk {8} 8.e0c916486616e1903c4b.js () 275 kB  [rendered]
Sign up to request clarification or add additional context in comments.

11 Comments

I have added this but it doesn't seem to have changed anything. Will the location be the normal location that it builds into if I do it inside of my IDE? Or do I need a special location for it to appear in the GitHub releases section? artifacts: "dist/angular-githubaction/*"
I should add, I do get files back from the action however, they're not compressed as expected.
Sorry, I'm not sure where are we now. So you have your files in release but you want them compressed, right?
Yeah, the files appear inside of the releases tab but they're not compressed as you might expect when you run ng build on your project.
You can use Archive using zip or tar to pack your folder and then set this zipped files as artifact.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.