Repository: ni/nitsm-python (language: python)

Issue:
Use build action from publish action
After we merge the action for testing the package build in #134, we should update the `publish-testpypi.yml` workflow to use the build workflow instead of duplicating the build code in the publish workflow.


Discussion / hints:

Fix patch:
diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml
new file mode 100644
index 0000000..f92db88
--- /dev/null
+++ b/.github/actions/build/action.yml
@@ -0,0 +1,15 @@
+name: Build Package
+
+runs:
+  using: composite
+
+  steps:
+  - name: Install dependencies
+    run: |
+      python -m pip install --upgrade pip
+      pip install build
+    shell: bash
+
+  - name: Build package
+    run: python -m build
+    shell: bash
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index f54dbfa..12cd19c 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -5,7 +5,8 @@ name: Lint
 
 on:
   pull_request:
-    branches: [ main ]
+    branches:
+      - main
 
 jobs:
   lint:
diff --git a/.gitignore b/.gitignore
index 88ed1da..9df3eca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,8 +11,7 @@ venv/
 .pytest_cache/
 *-results.xml
 
-# setuptools
-build/
+# build
 dist/
 *.egg-info
 


Test patch:
diff --git a/.github/workflows/publish-testpypi.yml b/.github/workflows/publish-testpypi.yml
index cafec8c..df67683 100644
--- a/.github/workflows/publish-testpypi.yml
+++ b/.github/workflows/publish-testpypi.yml
@@ -9,16 +9,15 @@ jobs:
 
     steps:
     - uses: actions/checkout@v2
+
     - name: Set up Python
       uses: actions/setup-python@v2
       with:
-        python-version: '3.6'
-    - name: Install dependencies
-      run: |
-        python -m pip install --upgrade pip
-        pip install build
+        python-version: 3.6
+
     - name: Build package
-      run: python -m build
+      uses: ./.github/actions/build
+
     - name: Publish package
       uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
       with:
diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml
index e31138a..361efeb 100644
--- a/.github/workflows/test-build.yml
+++ b/.github/workflows/test-build.yml
@@ -2,7 +2,8 @@ name: Test Build Package
 
 on:
   pull_request:
-    branches: [ main ]
+    branches:
+      - main
 
 jobs:
   build:
@@ -11,13 +12,11 @@ jobs:
 
     steps:
     - uses: actions/checkout@v2
+
     - name: Set up Python
       uses: actions/setup-python@v2
       with:
-        python-version: '3.6'
-    - name: Install dependencies
-      run: |
-        python -m pip install --upgrade pip
-        pip install build
+        python-version: 3.6
+
     - name: Build package
-      run: python -m build
+      uses: ./.github/actions/build