This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/cordova-plugin-network-information.git


The following commit(s) were added to refs/heads/master by this push:
     new 84f119b  chore(ci): draft release (#174)
84f119b is described below

commit 84f119b5f19ee3ae0ae0c02ba6a6c1414153797a
Author: エリス <[email protected]>
AuthorDate: Thu Apr 9 12:51:06 2026 +0000

    chore(ci): draft release (#174)
---
 .npmignore => .asf-release/.gitkeep |   7 +-
 .github/workflows/draft-release.yml | 149 ++++++++++++++++++++++++++++++++++++
 .gitignore                          |   4 +
 .npmignore                          |   3 +
 .npmignore => .npmrc                |   8 +-
 .ratignore => .rat-excludes         |   2 +
 .ratignore                          |   2 +
 7 files changed, 171 insertions(+), 4 deletions(-)

diff --git a/.npmignore b/.asf-release/.gitkeep
similarity index 80%
copy from .npmignore
copy to .asf-release/.gitkeep
index 10b946b..a926db8 100644
--- a/.npmignore
+++ b/.asf-release/.gitkeep
@@ -15,5 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-.*
-tests
+# ---
+# This directory is used as apart of the release process.
+# Package tarballs will be generated in stored temporarily
+# within this directory and should not be commited to repo.
+# ---
diff --git a/.github/workflows/draft-release.yml 
b/.github/workflows/draft-release.yml
new file mode 100644
index 0000000..98ecf5a
--- /dev/null
+++ b/.github/workflows/draft-release.yml
@@ -0,0 +1,149 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Draft Release
+
+on:
+  push:
+    tags:
+      - 'draft/**'
+
+permissions:
+  contents: read
+  id-token: write
+
+jobs:
+  upload-to-atr:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v6
+      - uses: actions/setup-node@v6
+        with:
+          node-version: 24
+
+      - name: Setup environment variables
+        run: |
+          REPO_NAME="${GITHUB_REPOSITORY#*/}"
+          TAG_NAME="${GITHUB_REF#refs/tags/}"
+          TARGET_RELEASE_VERSION="${TAG_NAME#draft/}"
+          SRC_PACKAGE_NAME=${REPO_NAME}-source-${TARGET_RELEASE_VERSION}
+          SRC_PACKAGE_TAR=${SRC_PACKAGE_NAME}.tar
+          SRC_PACKAGE_TAR_GZ=${SRC_PACKAGE_NAME}.tar.gz
+          SRC_PACKAGE_ZIP=${SRC_PACKAGE_NAME}.zip
+          NPM_PACKAGE_NAME=${REPO_NAME}-npm-${TARGET_RELEASE_VERSION}
+
+          echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
+          echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
+          echo "TARGET_RELEASE_VERSION=$TARGET_RELEASE_VERSION" >> $GITHUB_ENV
+          echo "SRC_PACKAGE_NAME=$SRC_PACKAGE_NAME" >> $GITHUB_ENV
+          echo "SRC_PACKAGE_TAR=$SRC_PACKAGE_TAR" >> $GITHUB_ENV
+          echo "SRC_PACKAGE_TAR_GZ=$SRC_PACKAGE_TAR_GZ" >> $GITHUB_ENV
+          echo "SRC_PACKAGE_ZIP=$SRC_PACKAGE_ZIP" >> $GITHUB_ENV
+          echo "NPM_PACKAGE_NAME=$NPM_PACKAGE_NAME" >> $GITHUB_ENV
+
+          echo "REPO_NAME=$REPO_NAME"
+          echo "TAG_NAME=$TAG_NAME"
+          echo "TARGET_RELEASE_VERSION=$TARGET_RELEASE_VERSION"
+          echo "SRC_PACKAGE_NAME=$SRC_PACKAGE_NAME"
+          echo "SRC_PACKAGE_TAR=$SRC_PACKAGE_TAR"
+          echo "SRC_PACKAGE_TAR_GZ=$SRC_PACKAGE_TAR_GZ"
+          echo "SRC_PACKAGE_ZIP=$SRC_PACKAGE_ZIP"
+          echo "NPM_PACKAGE_NAME=$NPM_PACKAGE_NAME"
+
+      - name: Verify Target Release Version
+        run: |
+          PACKAGE_VERSION=$(jq -r '.version' package.json)
+          if [ $PACKAGE_VERSION != "$TARGET_RELEASE_VERSION" ]; then
+            echo "Mismatch version detected between tag version 
($TARGET_RELEASE_VERSION) and package version ($PACKAGE_VERSION)"
+            exit 1
+          fi
+
+          if [ -f "plugin.xml" ]; then
+            PLUGIN_VERSION=$(yq -p=xml -o=json '.plugin.+@version' plugin.xml)
+            if [ $PLUGIN_VERSION != "$TARGET_RELEASE_VERSION" ]; then
+              echo "Mismatch version detected between tag version 
($TARGET_RELEASE_VERSION) and plugin version ($PLUGIN_VERSION)"
+              exit 1
+            fi
+          fi
+
+      - name: Generate "tgz" npm convenience package
+        run: |-
+          npm install
+          NPM_PKG_NAME=$(npm pack --json | jq -r '.[0].filename')
+          mv ./.asf-release/$NPM_PKG_NAME 
./.asf-release/${NPM_PACKAGE_NAME}.tgz
+        env:
+          TZ: UTC
+
+      - name: Generate "tar" source package
+        run: |-
+          export SRC_LAST_COMMIT_EPOCH=$(git log -1 --format=%ct "$TAG_NAME")
+
+          git archive \
+            --prefix=$SRC_PACKAGE_NAME/ \
+            --mtime=$SRC_LAST_COMMIT_EPOCH \
+            -o ./.asf-release/${SRC_PACKAGE_TAR} \
+            $TAG_NAME
+        env:
+          TZ: UTC
+
+      - name: Generate "tar.gz" source archive
+        working-directory: ./.asf-release
+        run: |-
+          gzip -n -9 -c "$SRC_PACKAGE_TAR" > "$SRC_PACKAGE_TAR_GZ"
+        env:
+          TZ: UTC
+
+      - name: Generate "zip" source archive
+        working-directory: ./.asf-release
+        run: |-
+          export ASF_RELEASE_DIR=$(pwd)
+          export TMP_DIR=$(mktemp -d)
+
+          tar -xf "$SRC_PACKAGE_TAR" -C "$TMP_DIR"
+          (
+            cd "$TMP_DIR"
+            find . -type f | LC_ALL=C sort | zip -X -q 
"$ASF_RELEASE_DIR/$SRC_PACKAGE_ZIP" -@
+          )
+          rm -rf $TMP_DIR
+        env:
+          TZ: UTC
+
+      - name: Cleanup Process
+        working-directory: ./.asf-release
+        run: |-
+          rm -rf $SRC_PACKAGE_TAR
+          rm -rf .gitkeep
+
+      - name: Create Sign and Checksum
+        working-directory: .asf-release
+        run: |-
+          for f in *.tar.gz *.tgz *.zip; do
+            [ -e "$f" ] || continue
+            echo "$CORDOVA_GPG_SECRET_KEY" | gpg --batch --import 
--import-options import-show
+            gpg --armor --detach-sign "$f"
+            sha512sum "$f" > "${f}.sha512"
+          done
+        env:
+          CORDOVA_GPG_SECRET_KEY: ${{ secrets.CORDOVA_GPG_SECRET_KEY }}
+
+      - name: Upload to Apache Trusted Release (ATR)
+        uses: 
apache/tooling-actions/upload-to-atr@b7e972c11790ee16eca101900af1b3c7fd1b106e
+        with:
+          project: ${{ env.REPO_NAME }}
+          version: ${{ env.TARGET_RELEASE_VERSION }}
+          src: .asf-release
diff --git a/.gitignore b/.gitignore
index 3e4cbb3..1d69092 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,7 @@ Thumbs.db
 *.user
 
 node_modules
+
+# ASF release workspace
+.asf-release/
+!.asf-release/.gitkeep
diff --git a/.npmignore b/.npmignore
index 10b946b..3552679 100644
--- a/.npmignore
+++ b/.npmignore
@@ -17,3 +17,6 @@
 
 .*
 tests
+
+# ASF release workspace
+.asf-release/
diff --git a/.npmignore b/.npmrc
similarity index 86%
copy from .npmignore
copy to .npmrc
index 10b946b..6f982f7 100644
--- a/.npmignore
+++ b/.npmrc
@@ -15,5 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-.*
-tests
+registry=https://registry.npmjs.org
+
+# ASF release settings
+git-tag-version=false
+preid=dev
+pack-destination=./.asf-release
diff --git a/.ratignore b/.rat-excludes
similarity index 97%
copy from .ratignore
copy to .rat-excludes
index 6c43da8..295a332 100644
--- a/.ratignore
+++ b/.rat-excludes
@@ -15,6 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# This file used by ATR
+
 .git/
 node_modules/
 src/ios/CDVReachability.h
diff --git a/.ratignore b/.ratignore
index 6c43da8..9907e8d 100644
--- a/.ratignore
+++ b/.ratignore
@@ -15,6 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# This file used by release audit workflow
+
 .git/
 node_modules/
 src/ios/CDVReachability.h


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to