Revert "ci: allow workflow_dispatch to upload to an existing release tag"
This reverts commit 0bceb1e2a0.
This commit is contained in:
parent
0bceb1e2a0
commit
e87f331a1f
1 changed files with 13 additions and 24 deletions
37
.github/workflows/release.yml
vendored
37
.github/workflows/release.yml
vendored
|
|
@ -4,19 +4,12 @@ on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
release_tag:
|
|
||||||
description: 'Upload artifacts to this existing release tag (e.g. v0.5.4). Leave empty for build-only.'
|
|
||||||
required: false
|
|
||||||
default: ''
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-appimage:
|
build-appimage:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
env:
|
|
||||||
RELEASE_TAG: ${{ github.event_name == 'release' && github.ref_name || inputs.release_tag }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -63,19 +56,17 @@ jobs:
|
||||||
mv Open*CAD*Studio*.AppImage OpenCADStudio.AppImage
|
mv Open*CAD*Studio*.AppImage OpenCADStudio.AppImage
|
||||||
|
|
||||||
- name: Upload AppImage to release
|
- name: Upload AppImage to release
|
||||||
if: github.event_name == 'release' || inputs.release_tag != ''
|
if: github.event_name == 'release'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
mv OpenCADStudio.AppImage OpenCADStudio-${{ env.RELEASE_TAG }}-linux-x86_64.AppImage
|
mv OpenCADStudio.AppImage OpenCADStudio-${{ github.ref_name }}-linux-x86_64.AppImage
|
||||||
gh release upload ${{ env.RELEASE_TAG }} OpenCADStudio-${{ env.RELEASE_TAG }}-linux-x86_64.AppImage --clobber --repo ${{ github.repository }}
|
gh release upload ${{ github.ref_name }} OpenCADStudio-${{ github.ref_name }}-linux-x86_64.AppImage --clobber --repo ${{ github.repository }}
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
env:
|
|
||||||
RELEASE_TAG: ${{ github.event_name == 'release' && github.ref_name || inputs.release_tag }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -119,7 +110,7 @@ jobs:
|
||||||
- name: Build MSI installer
|
- name: Build MSI installer
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$version = "${{ env.RELEASE_TAG }}" -replace '^v', ''
|
$version = "${{ github.ref_name }}" -replace '^v', ''
|
||||||
# workflow_dispatch runs use the branch name as ref_name, which
|
# workflow_dispatch runs use the branch name as ref_name, which
|
||||||
# is not a valid MSI ProductVersion — fall back to 0.0.0 so test
|
# is not a valid MSI ProductVersion — fall back to 0.0.0 so test
|
||||||
# builds still produce an installer.
|
# builds still produce an installer.
|
||||||
|
|
@ -174,12 +165,12 @@ jobs:
|
||||||
timestamp-digest: SHA256
|
timestamp-digest: SHA256
|
||||||
|
|
||||||
- name: Upload artifacts to release
|
- name: Upload artifacts to release
|
||||||
if: github.event_name == 'release' || inputs.release_tag != ''
|
if: github.event_name == 'release'
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
$tag = "${{ env.RELEASE_TAG }}"
|
$tag = "${{ github.ref_name }}"
|
||||||
# Ship both the bare .exe (portable, no install) and the
|
# Ship both the bare .exe (portable, no install) and the
|
||||||
# .msi (installer with Start Menu shortcut + .dwg / .dxf
|
# .msi (installer with Start Menu shortcut + .dwg / .dxf
|
||||||
# file association). The `-portable` / `-installer` suffix
|
# file association). The `-portable` / `-installer` suffix
|
||||||
|
|
@ -195,8 +186,6 @@ jobs:
|
||||||
runs-on: macos-14 # Apple Silicon (arm64) only
|
runs-on: macos-14 # Apple Silicon (arm64) only
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
env:
|
|
||||||
RELEASE_TAG: ${{ github.event_name == 'release' && github.ref_name || inputs.release_tag }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -238,7 +227,7 @@ jobs:
|
||||||
chmod +x "$APP/Contents/MacOS/OpenCADStudio"
|
chmod +x "$APP/Contents/MacOS/OpenCADStudio"
|
||||||
cp AppIcon.icns "$APP/Contents/Resources/AppIcon.icns"
|
cp AppIcon.icns "$APP/Contents/Resources/AppIcon.icns"
|
||||||
# Substitute version into Info.plist.
|
# Substitute version into Info.plist.
|
||||||
VERSION="${{ env.RELEASE_TAG }}"
|
VERSION="${{ github.ref_name }}"
|
||||||
VERSION="${VERSION#v}"
|
VERSION="${VERSION#v}"
|
||||||
[ -z "$VERSION" ] && VERSION="0.0.0"
|
[ -z "$VERSION" ] && VERSION="0.0.0"
|
||||||
sed "s/__VERSION__/$VERSION/g" packaging/Info.plist > "$APP/Contents/Info.plist"
|
sed "s/__VERSION__/$VERSION/g" packaging/Info.plist > "$APP/Contents/Info.plist"
|
||||||
|
|
@ -275,23 +264,23 @@ jobs:
|
||||||
test -f OpenCADStudio.dmg
|
test -f OpenCADStudio.dmg
|
||||||
|
|
||||||
- name: Upload .dmg to release
|
- name: Upload .dmg to release
|
||||||
if: github.event_name == 'release' || inputs.release_tag != ''
|
if: github.event_name == 'release'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
mv OpenCADStudio.dmg OpenCADStudio-${{ env.RELEASE_TAG }}-macos-arm64.dmg
|
mv OpenCADStudio.dmg OpenCADStudio-${{ github.ref_name }}-macos-arm64.dmg
|
||||||
gh release upload ${{ env.RELEASE_TAG }} OpenCADStudio-${{ env.RELEASE_TAG }}-macos-arm64.dmg --clobber --repo ${{ github.repository }}
|
gh release upload ${{ github.ref_name }} OpenCADStudio-${{ github.ref_name }}-macos-arm64.dmg --clobber --repo ${{ github.repository }}
|
||||||
|
|
||||||
- name: Emit Homebrew cask sha256
|
- name: Emit Homebrew cask sha256
|
||||||
if: github.event_name == 'release' || inputs.release_tag != ''
|
if: github.event_name == 'release'
|
||||||
run: |
|
run: |
|
||||||
# Print the values needed to bump the Homebrew cask
|
# Print the values needed to bump the Homebrew cask
|
||||||
# (packaging/homebrew/open-cad-studio.rb) for this release, so the
|
# (packaging/homebrew/open-cad-studio.rb) for this release, so the
|
||||||
# tap can be updated with a copy-paste instead of computing the
|
# tap can be updated with a copy-paste instead of computing the
|
||||||
# digest by hand.
|
# digest by hand.
|
||||||
VERSION="${{ env.RELEASE_TAG }}"
|
VERSION="${{ github.ref_name }}"
|
||||||
VERSION="${VERSION#v}"
|
VERSION="${VERSION#v}"
|
||||||
SHA=$(shasum -a 256 OpenCADStudio-${{ env.RELEASE_TAG }}-macos-arm64.dmg | awk '{print $1}')
|
SHA=$(shasum -a 256 OpenCADStudio-${{ github.ref_name }}-macos-arm64.dmg | awk '{print $1}')
|
||||||
{
|
{
|
||||||
echo "## Homebrew cask bump"
|
echo "## Homebrew cask bump"
|
||||||
echo "Update \`packaging/homebrew/open-cad-studio.rb\`:"
|
echo "Update \`packaging/homebrew/open-cad-studio.rb\`:"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue