test new generete release #7
Workflow file for this run
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: Publish and Release | |
on: | |
push: | |
branches: | |
- workflow # Triggers the workflow on pushes to the workflow branch | |
workflow_dispatch: # Allows manual triggering of the workflow | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Bump Version, Build, and Publish to NPM | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 21 | |
cache: "npm" | |
- name: Install dependencies | |
run: npm install | |
- name: Bump Version | |
id: bump-version | |
run: | | |
NEW_VERSION=$(npm version patch --no-git-tag-version) | |
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV | |
echo "Updated version to ${NEW_VERSION}" | |
- name: Commit and Push New Version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "actions@github.com" | |
git add package.json package-lock.json | |
git commit -m "chore: bump version to ${{ env.NEW_VERSION }}" | |
git push origin workflow | |
- name: Create Git Tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git tag ${NEW_VERSION} | |
git push origin ${NEW_VERSION} | |
- name: Build package | |
run: npm run build | |
# - name: Publish to npm | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# run: npm publish | |
release: | |
name: Create GitHub Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Extract Package Version | |
id: get-version | |
run: | | |
VERSION=$(jq -r '.version' package.json) | |
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV | |
# - name: Create Release | |
# uses: actions/create-release@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tag_name: ${{ env.PACKAGE_VERSION }} | |
# release_name: "Release v${{ env.PACKAGE_VERSION }}" | |
# body: | | |
# New release of **expo-check-installed-apps** is available. | |
# - Version: v${{ env.PACKAGE_VERSION }} | |
# - [Changelog](https://github.com/EndLess728/expo-check-installed-apps/releases) | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
# files: android/app/build/outputs/apk/release/app-release.apk # The path to the APK file to upload. | |
tag_name: "${{ env.PACKAGE_VERSION }}" # Tag the release with the generated version. | |
name: "Release v${{ env.PACKAGE_VERSION }}" # Name the release with the version. | |
generate_release_notes: true # Do not regenerate release notes (they're provided by the changelog). | |
draft: false # The release will not be a draft. | |
prerelease: false # The release will not be a pre-release. | |
body: | | |
New release of **expo-check-installed-apps** is available. | |
- Version: v${{ env.PACKAGE_VERSION }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |