Skip to content

Use correct refres token function #3

Use correct refres token function

Use correct refres token function #3

Workflow file for this run

name: Build and Upload Artifact
on:
push:
branches:
- main # Adjust the branch name if needed
jobs:
read-package-json:
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.save_output.outputs.version}}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Read package.json
id: save_output
run: |
echo "version=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT"
create-github-release:
needs: [read-package-json]
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.save_output.outputs.upload_url }}
release_id: ${{ steps.save_output.outputs.release_id }}
steps:
- name: Delete all releases
uses: larryjoelane/delete-release-action@v1.0.24
with:
release-name: ${{ needs.read-package-json.outputs.package_version }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.read-package-json.outputs.package_version}}
release_name: Release ${{ needs.read-package-json.outputs.package_version}}
body: |
Release of the Spotify Package for the Grid Editor
draft: false
prerelease: false
- name: Save release output
id: save_output
run: |
echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> "$GITHUB_OUTPUT"
echo "release_id=${{ steps.create_release.outputs.id }}" >> "$GITHUB_OUTPUT"
build:
runs-on: ${{ matrix.os }}
needs: create-github-release
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# os: [macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18 # Specify the desired Node.js version
- name: Install dependencies
run: npm install
- name: Build components
run: |
cd components
npm install
npm run build
- name: Install archiver package
run: npm install archiver
- name: Run build script
run: node build.js
- name: Upload Artifact
uses: tanyagray/action-upload-release-asset@v1.1.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-github-release.outputs.upload_url }}
asset_path: package-archive.zip
asset_name: package-spotify-${{ matrix.os }}.zip
asset_content_type: application/zip
publish-release:
needs: [build, create-github-release]
runs-on: ubuntu-latest
steps:
- name: Publish Release
uses: eregon/publish-release@v1.0.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.create-github-release.outputs.release_id}}