diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml deleted file mode 100644 index a1030f5..0000000 --- a/.github/workflows/create-release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Create release - -on: - workflow_dispatch: - inputs: - tag: - description: "Git tag value in sem ver" - required: true - type: string - -env: - NODE_VERSION: latest - GIT_MAIN_BRANCH: main - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - ref: ${{ env.GIT_MAIN_BRANCH }} - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Set up Git user - uses: fregante/setup-git-user@v2 - - - name: Get release version - id: version - run: echo "VALUE=$(npx --yes semver ${{ github.event.inputs.tag }})" >> "$GITHUB_OUTPUT" - - - name: Update project version - run: | - npm version ${{ steps.version.outputs.VALUE }} --no-git-tag-version - git add package.json - git commit -m "chore: release ${{ steps.version.outputs.VALUE }}" - git push - git tag ${{ steps.version.outputs.VALUE }} - git push origin ${{ steps.version.outputs.VALUE }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 83d0c2d..962fab6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: Push Docker images to GHCR +name: Release on: # Runs on tagged releases @@ -11,6 +11,7 @@ on: env: IMAGE_NAME: ghcr.io/rdflib/prez-ui + NODE_VERSION: latest # Grants permissions for GITHUB_TOKEN permissions: @@ -20,7 +21,7 @@ permissions: jobs: # build & push Docker image - docker: + build-container-image: runs-on: ubuntu-latest steps: - name: Checkout repo @@ -57,3 +58,28 @@ jobs: # Set provenance to false due to issue documented here: https://github.com/docker/build-push-action/issues/778 provenance: false platforms: linux/amd64,linux/arm64 + + upload: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Get release version + id: version + run: echo "VALUE=$(npx --yes semver ${{ github.event.inputs.tag }})" >> "$GITHUB_OUTPUT" + + - name: Update project version and zip file + run: | + npm version ${{ steps.version.outputs.VALUE }} --no-git-tag-version + cd .. && zip -r prez-ui-${{ steps.version.outputs.VALUE }}.zip prez-ui + + - name: Upload release asset + uses: softprops/action-gh-release@v1 + with: + files: ../prez-ui-${{ steps.version.outputs.VALUE }}.zip