diff --git a/.github/actions/always/action.yml b/.github/actions/always/action.yml deleted file mode 100644 index 37e76413fa..0000000000 --- a/.github/actions/always/action.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: cleanup -# https://github.com/product-os/flowzone/tree/master/.github/actions -inputs: - json: - description: "JSON stringified object containing all the inputs from the calling workflow" - required: true - secrets: - description: "JSON stringified object containing all the secrets from the calling workflow" - required: true - - # --- custom environment - VERBOSE: - type: string - default: "true" - -runs: - # https://docs.github.com/en/actions/creating-actions/creating-a-composite-action - using: "composite" - steps: - # delete draft releases if the pull request is closed without merging - - name: Delete draft release - if: | - runner.os == 'Linux' && - github.event_name == 'pull_request' && - github.event.pull_request.merged == false && - github.event.action == 'closed' - - shell: bash --noprofile --norc -eo pipefail -x {0} - run: | - set -ea - - [[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x - - gh release delete --yes '${{ github.event.pull_request.head.ref }}' || true - - env: - GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} diff --git a/.github/actions/finalize/action.yml b/.github/actions/finalize/action.yml deleted file mode 100644 index 79536a4967..0000000000 --- a/.github/actions/finalize/action.yml +++ /dev/null @@ -1,54 +0,0 @@ ---- -name: publish GitHub release -# https://github.com/product-os/flowzone/tree/master/.github/actions -inputs: - json: - description: "JSON stringified object containing all the inputs from the calling workflow" - required: true - secrets: - description: "JSON stringified object containing all the secrets from the calling workflow" - required: true - -runs: - # https://docs.github.com/en/actions/creating-actions/creating-a-composite-action - using: "composite" - steps: - - name: Get release version - if: runner.os == 'Linux' - id: get_release - shell: bash --noprofile --norc -eo pipefail -x {0} - run: | - set -ea - - [[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x - - echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT - - # https://docs.github.com/en/rest/releases - - name: Finalize GitHub release - if: runner.os == 'Linux' - shell: bash --noprofile --norc -eo pipefail -x {0} - run: | - set -ea - - [[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x - - previous_tag="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)" - release_notes="$(git log ${previous_tag}..HEAD --pretty=reference)" - - gh release edit '${{ github.event.pull_request.head.ref }}' \ - --notes "${release_notes}" \ - --title 'v${{ steps.get_release.outputs.version }}' \ - --tag 'v${{ steps.get_release.outputs.version }}' \ - --prerelease=false \ - --draft=false - - release_id="$(gh api "/repos/${{ github.repository }}/releases/tags/v${{ steps.get_release.outputs.version }}" \ - -H 'Accept: application/vnd.github+json' | jq -r .id)" - - gh api --method PATCH "/repos/${{ github.repository }}/releases/${release_id}" \ - -H 'Accept: application/vnd.github+json' \ - -F make_latest="true" - - env: - GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index f5f045a2a8..2b33c0b114 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -206,33 +206,9 @@ runs: -name "latest*.yml" \ -exec yq -i e .stagingPercentage=\"$percentage\" {} \; - # https://github.com/softprops/action-gh-release#-customizing - - name: Create draft GitHub (pre)release - uses: softprops/action-gh-release@v1 - with: - # use PR branch name for draft releases - name: ${{ github.event.pull_request.head.ref }} - tag_name: ${{ github.event.pull_request.head.ref }} - draft: true - prerelease: true - token: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} - files: | - dist/*.AppImage - dist/*.blockmap - dist/*.deb - dist/*.dmg - dist/*.exe - dist/*.rpm - dist/*.zip - dist/latest*.yml - - - name: Compress custom source - shell: pwsh - run: tar -acf ${{ runner.temp }}/custom.tgz . - - - name: Upload custom artifact + - name: Upload artifacts uses: actions/upload-artifact@v3 with: - name: custom-${{ github.event.pull_request.head.sha || github.event.head_commit.id }}-${{ runner.os }} - path: ${{ runner.temp }}/custom.tgz + name: gh-release-${{ github.event.pull_request.head.sha || github.event.head_commit.id }} + path: dist retention-days: 1 diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index a1620a4e78..3bb1d32278 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -21,19 +21,6 @@ runs: # https://docs.github.com/en/actions/creating-actions/creating-a-composite-action using: "composite" steps: - - name: Delete previous draft release - if: runner.os == 'Linux' - shell: bash --noprofile --norc -eo pipefail -x {0} - run: | - set -ea - - [[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x - - gh release delete --yes '${{ github.event.pull_request.head.ref }}' || true - - env: - GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} - # https://github.com/actions/setup-node#caching-global-packages-data - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/flowzone.yml b/.github/workflows/flowzone.yml index 6e579653f6..cc51570bec 100644 --- a/.github/workflows/flowzone.yml +++ b/.github/workflows/flowzone.yml @@ -22,3 +22,9 @@ jobs: with: tests_run_on: '["ubuntu-18.04","macos-latest","windows-2019"]' restrict_custom_actions: false + github_prerelease: true +# repo_config: true +# repo_description: | +# Flash OS images to SD cards & USB drives, safely and easily. +# repo_homepage: https://etcher.io/ +# repo_enable_wiki: true