diff --git a/.github/workflows/auto release.yml b/.github/workflows/auto release.yml index 0ea254e..5fc3486 100644 --- a/.github/workflows/auto release.yml +++ b/.github/workflows/auto release.yml @@ -1,26 +1,57 @@ -# This is a basic workflow to help you get started with the GitHub Auto-Release on Commit Action. - name: AutoRelease on: push: branches: [ master ] -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" release: - # The type of runner that the job will run on runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - uses: actions/checkout@v2 - - uses: CupOfTea696/gh-action-auto-release@v1.0.0 + + - name: Set up Node.js + uses: actions/setup-node@v3 with: - title: "Release: $version" - tag: "v$semver" + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Find and Extract .jar from ZIP + run: | + # Find the ZIP file + ZIP_FILE=$(find . -type f -name "*.zip") + echo "Found ZIP file: $ZIP_FILE" + + # Extract the .jar file from the ZIP + unzip -j "$ZIP_FILE" "*.jar" -d ./extracted + ls -l ./extracted + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + Changes in this release: + - Add your changes here draft: false - regex: "/^Release: #{semver}$/i" + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./extracted/*.jar + asset_name: $(basename ./extracted/*.jar) + asset_content_type: application/java-archive