Compare commits

...

3 Commits

Author SHA1 Message Date
TingluoHuang
b85caf7640 doc 2022-01-18 22:50:28 -05:00
Tingluo Huang
e9e2d354c2 Update README.md 2021-10-26 21:45:39 -04:00
Tingluo Huang
d5a1710f1f Update docker-image.yml 2021-10-25 22:37:57 -04:00
5 changed files with 32 additions and 7 deletions

View File

@@ -1,17 +1,13 @@
name: Build Alpine Node.js
permissions:
contents: write
on:
workflow_dispatch:
inputs:
NodeVersion:
required: true
description: 'Node.js version to build (ex: v12.4.0)'
PythonVersion:
required: true
description: 'Node.js v12 needs python2 and Node.js v16 needs python3'
description: 'Node.js version to build (ex: v12.22.7, v16.12.0)'
jobs:
build:
@@ -21,7 +17,15 @@ jobs:
- uses: actions/checkout@v2
- name: Build the Docker image
run: |
docker build --file Dockerfile --tag alpine_nodejs:${{github.event.inputs.NodeVersion}} --build-arg NodeVersion=${{github.event.inputs.NodeVersion}} --build-arg PythonVersion=${{github.event.inputs.PythonVersion}} .
NodeVersion="${{github.event.inputs.NodeVersion}}"
PythonVersion="python3"
if [[ $NodeVersion = v12* ]]
then
PythonVersion="python2"
fi
echo node.js version $NodeVersion
echo python version $PythonVersion
docker build --file Dockerfile --tag alpine_nodejs:${{github.event.inputs.NodeVersion}} --build-arg NodeVersion=${{github.event.inputs.NodeVersion}} --build-arg PythonVersion=$PythonVersion .
- name: Copy alpine node.js out
run: |
mkdir $RUNNER_TEMP/alpine_node

View File

@@ -1 +1,22 @@
# alpine_nodejs
# alpine_nodejs
[GitHub Actions Runner](https://github.com/actions/runner/blob/main/src/Misc/externals.sh) download alpine node.js from https://vstsagenttools.blob.core.windows.net/tools/nodejs
The [workflow](https://github.com/TingluoHuang/alpine_nodejs/actions/workflows/docker-image.yml) in this repository can compile a partial-static node.js for alpine and create a [GitHub release](https://github.com/TingluoHuang/alpine_nodejs/releases) for it.
- Queue workflow using `workflow_dispatch` trigger and set the `node` version you want to compile as input, ex: `v12.22.7`
![queue workflow](./res/queueWorkflow.png)
- Wait for the run to complete
![succeed run](./res/succeedRun.png)
- There should be a newly created release that matches the version you want for `node`, and it is able to run on alpine.
![new release](./res/createdRelease.png)
- Once we get [approval](https://github.com/github/open-source-releases/issues/205) to change the current repository from `private` to `public`, then we can consume the release assets directly. In the meantime, you will need to follow [instructions](https://dev.azure.com/mseng/AzureDevOps/_wiki/wikis/AzureDevOps.wiki/4037/How-to-upload-resource-to-vstsagenttools.blob.core.windows.net) to check-in the compiled alpine node.js from the release assets as a `Git-LFS` files to https://dev.azure.com/mseng/AzureDevOps/_git/CIPlat.Externals and get it mirror into https://vstsagenttools.blob.core.windows.net/tools/nodejs
> Tips for working with `CIPlat.Externals` repository:
> - The repository is huge right now, you don't want to waste your time and disk space to get those unrelated files.
> - Ignore LFS files during initial `git clone` the repo with `GIT_LFS_SKIP_SMUDGE=1 git clone https://mseng@dev.azure.com/mseng/AzureDevOps/_git/CIPlat.Externals`
> - Ignore LFS files during any `git checkout` or `git fetch` operation with `GIT_LFS_SKIP_SMUDGE=1`.
> - You do want the LFS smudge filter to run during `git add` and `git push`, make sure you don't have `GIT_LFS_SKIP_SMUDGE=1` when you run `git add` and `git push`.
> - More `Git-LFS` doc is at https://github.com/git-lfs/git-lfs/tree/main/docs

BIN
res/createdRelease.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

BIN
res/queueWorkflow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

BIN
res/succeedRun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB