Update release.yml #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITEA_NPM_REGISTRY }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Setup Node.js lts/* | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: 'yarn' | |
registry-url: https://gitea.midpathsoftware.com/api/packages/gnpaone/npm | |
always-auth: true | |
scope: '' | |
- run: | | |
CURRENT_DIR=$(pwd) | |
# Define the .npmrc file path | |
NPMRC_FILE="$CURRENT_DIR/.npmrc" | |
# Check if the file exists | |
if [[ -f "$NPMRC_FILE" ]]; then | |
cat "$NPMRC_FILE" | |
else | |
echo "Error: .npmrc file not found in $CURRENT_DIR" | |
exit 1 | |
fi | |
# - name: Install Dependencies | |
# run: yarn install --frozen-lockfile | |
- name: Set registry settings | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
registry=https://gitea.midpathsoftware.com/api/packages/gnpaone/npm/ | |
@rrweb:registry=https://gitea.midpathsoftware.com/api/packages/gnpaone/npm/ | |
//gitea.midpathsoftware.com/api/packages/gnpaone/npm/:_authToken="${NODE_AUTH_TOKEN}" | |
//gitea.midpathsoftware.com/api/packages/gnpaone/npm/:always-auth=true | |
EOF | |
- run: | | |
CURRENT_DIR=$(pwd) | |
# Define the .npmrc file path | |
NPMRC_FILE="$CURRENT_DIR/.npmrc" | |
# Check if the file exists | |
if [[ -f "$NPMRC_FILE" ]]; then | |
cat "$NPMRC_FILE" | |
else | |
echo "Error: .npmrc file not found in $CURRENT_DIR" | |
exit 1 | |
fi | |
- run: | | |
NPMRC_FILE="$HOME/.npmrc" | |
# Check if the file exists | |
if [[ -f "$NPMRC_FILE" ]]; then | |
cat "$NPMRC_FILE" | |
fi | |
# - name: Create Release Pull Request or Publish to npm | |
# id: changesets | |
# uses: changesets/action@v1 | |
# with: | |
# publish: yarn run release | |
# env: | |
# NODE_OPTIONS: '--max-old-space-size=4096' | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |