action-gh-release icon indicating copy to clipboard operation
action-gh-release copied to clipboard

GitHub Releases requires a tag

Open Angelk90 opened this issue 1 year ago • 1 comments

Hi @softprops , I'm using the following code to create an artifact and then to be able to automatically create a release.

At the time of creation I don't have a tag, how can I do?

on:
  workflow_dispatch:
    inputs:

name: Build  
jobs:
  install-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install npm dependencies
        run: |
          npm install
  build-android:
    needs: install-and-test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install npm dependencies
        run: |
          npm install
      - name: Build Android Release
        run: |
          cd android && ./gradlew assembleRelease
      - name: Upload Artifact
        uses: actions/upload-artifact@v1
        with:
          name: app-release.apk
          path: android/app/build/outputs/apk/release/
      - name: Release
        uses: softprops/action-gh-release@v1
        # if: startsWith(github.ref, 'refs/tags/')
        with:
          # Identify if this is a pre release by checking if the tag name contains -rc, -b, -a
          # prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }}
          files: android/app/build/outputs/apk/release/app-release.apk
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Angelk90 avatar Mar 25 '23 12:03 Angelk90

This is a duplicate of #270.

TomasHubelbauer avatar May 28 '23 15:05 TomasHubelbauer