2022-06-19 15:16:03 +02:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
2022-08-17 23:25:52 +02:00
|
|
|
workflow_dispatch:
|
2022-06-19 15:16:03 +02:00
|
|
|
|
|
|
|
jobs:
|
2022-08-17 15:50:11 +02:00
|
|
|
release-common:
|
2022-06-19 15:16:03 +02:00
|
|
|
runs-on: ubuntu-latest
|
2022-08-17 15:50:11 +02:00
|
|
|
name: Release Common
|
2022-06-19 15:16:03 +02:00
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
steps:
|
|
|
|
- name: 🧰 Checkout
|
2022-06-19 15:16:03 +02:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: ImHex
|
|
|
|
submodules: recursive
|
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
- name: 📜 Verify version and set version variable
|
|
|
|
run: |
|
|
|
|
project_version=`cat ImHex/VERSION`
|
|
|
|
tag_version="${{github.event.release.tag_name}}"
|
|
|
|
tag_version="${tag_version:1}"
|
|
|
|
if [ "$project_version" != "$tag_version" ]; then
|
|
|
|
echo "::warning::$project_version and $tag_version are not the same ! Refusing to populate release"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-07-18 20:02:12 +02:00
|
|
|
echo "IMHEX_VERSION=$project_version" >> $GITHUB_ENV
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
- name: 🗜️ Create tarball from sources with dependencies
|
2022-07-05 10:12:16 +02:00
|
|
|
run: tar --exclude-vcs -czvf Full.Sources.tar.gz ImHex
|
2022-06-19 15:16:03 +02:00
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
- name: ⬇️ Download artifacts from latest workflow
|
2022-06-19 15:16:03 +02:00
|
|
|
uses: dawidd6/action-download-artifact@v2
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
workflow: build.yml
|
2022-06-29 15:01:08 +02:00
|
|
|
branch: ${{ github.event.release.target_commitish }}
|
2022-06-19 15:16:03 +02:00
|
|
|
workflow_conclusion: success
|
|
|
|
skip_unpack: true
|
2022-06-29 15:01:08 +02:00
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
- name: 🗜️ Unzip files when needed
|
2022-06-29 15:01:08 +02:00
|
|
|
run: |
|
|
|
|
for zipfile in ./*.zip
|
|
|
|
do
|
|
|
|
if [ `zipinfo -1 "$zipfile" | wc -l` -eq 1 ];
|
|
|
|
then
|
|
|
|
echo "unzipping $zipfile"
|
|
|
|
unzip "$zipfile"
|
|
|
|
rm "$zipfile"
|
|
|
|
else
|
|
|
|
echo "keeping $zipfile zipped"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2022-09-02 16:12:02 +02:00
|
|
|
- name: 🟩 Rename artifacts when needed
|
|
|
|
run: |
|
2023-01-12 08:25:28 +01:00
|
|
|
mv "Windows Portable x86_64.zip" imhex-${{env.IMHEX_VERSION}}-Windows-Portable-x86_64.zip
|
|
|
|
mv "Windows Portable NoGPU x86_64.zip" imhex-${{env.IMHEX_VERSION}}-Windows-Portable-NoGPU-x86_64.zip
|
2022-06-29 15:01:08 +02:00
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
- name: ⬆️ Upload everything to release
|
2022-06-19 15:16:03 +02:00
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2022-08-04 20:37:57 +02:00
|
|
|
files: '*'
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
- name: ✒️ Prepare PKGBUILD
|
|
|
|
run: |
|
|
|
|
cp ImHex/dist/Arch/PKGBUILD .
|
|
|
|
|
2023-01-12 08:25:28 +01:00
|
|
|
hash=`md5sum imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst-x86_64 | cut -d ' ' -f 1`
|
2022-07-04 21:40:22 +02:00
|
|
|
|
2022-07-18 20:02:12 +02:00
|
|
|
sed -i 's/%version%/${{env.IMHEX_VERSION}}/g' PKGBUILD
|
2022-07-04 21:40:22 +02:00
|
|
|
sed -i "s/(SKIP)/($hash)/g" PKGBUILD
|
|
|
|
|
|
|
|
- name: ⬆️ Publish AUR package
|
|
|
|
|
|
|
|
# I couldn't make the condition in the env directly for some reason
|
|
|
|
env:
|
2022-07-18 20:02:12 +02:00
|
|
|
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
|
|
|
if: "${{ env.AUR_SSH_PRIVATE_KEY != '' }}"
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
uses: KSXGitHub/github-actions-deploy-aur@v2
|
|
|
|
with:
|
|
|
|
pkgname: imhex-bin
|
|
|
|
pkgbuild: ./PKGBUILD
|
|
|
|
commit_username: iTrooz
|
|
|
|
commit_email: itrooz@protonmail.com
|
|
|
|
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
2022-07-18 20:02:12 +02:00
|
|
|
commit_message: Bump to version ${{env.IMHEX_VERSION}}
|
2022-07-04 21:40:22 +02:00
|
|
|
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
|
2022-07-07 16:10:21 +02:00
|
|
|
|
2022-07-18 20:02:12 +02:00
|
|
|
- name: 🎫 Create PatternLanguage release
|
|
|
|
uses: ncipollo/release-action@v1
|
2022-07-07 16:10:21 +02:00
|
|
|
env:
|
2022-07-18 20:02:12 +02:00
|
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
if: "${{ env.RELEASE_TOKEN != '' }}"
|
2022-07-07 16:10:21 +02:00
|
|
|
with:
|
2022-07-18 20:02:12 +02:00
|
|
|
tag: ImHex-v${{env.IMHEX_VERSION}}
|
2022-07-07 16:10:21 +02:00
|
|
|
repo: PatternLanguage
|
|
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
2022-07-18 20:02:12 +02:00
|
|
|
|
|
|
|
- name: 🎫 Create ImHex-Patterns release
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
env:
|
|
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
if: "${{ env.RELEASE_TOKEN != '' }}"
|
|
|
|
with:
|
|
|
|
tag: ImHex-v${{env.IMHEX_VERSION}}
|
|
|
|
repo: ImHex-Patterns
|
|
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
2022-08-17 22:32:55 +02:00
|
|
|
|
|
|
|
- name: ✉️ Update C++ Plugin Template
|
2023-01-13 08:58:03 +01:00
|
|
|
uses: peter-evans/repository-dispatch@v2
|
2022-09-08 09:31:49 +02:00
|
|
|
env:
|
|
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
if: "${{ env.RELEASE_TOKEN != '' }}"
|
2022-08-17 22:32:55 +02:00
|
|
|
with:
|
2022-08-17 23:25:52 +02:00
|
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
2023-01-13 08:58:03 +01:00
|
|
|
repository: WerWolv/ImHex-Cpp-Plugin-Template
|
2022-10-21 14:59:39 +02:00
|
|
|
event_type: update_submodule
|
|
|
|
|
|
|
|
- name: ✉️ Update Rust Plugin Template
|
2023-01-13 08:58:03 +01:00
|
|
|
uses: peter-evans/repository-dispatch@v2
|
2022-10-21 14:59:39 +02:00
|
|
|
env:
|
|
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
if: "${{ env.RELEASE_TOKEN != '' }}"
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
2023-01-13 08:58:03 +01:00
|
|
|
repository: WerWolv/ImHex-Rust-Plugin-Template
|
2022-08-17 22:32:55 +02:00
|
|
|
event_type: update_submodule
|
2022-08-17 15:50:11 +02:00
|
|
|
|
|
|
|
release-windows:
|
|
|
|
name: Release Windows
|
|
|
|
needs: release-common
|
|
|
|
runs-on: windows-2022
|
|
|
|
steps:
|
|
|
|
- name: ⬇️ Download dependencies
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2022-09-16 08:30:42 +02:00
|
|
|
iwr https://github.com/microsoft/winget-create/releases/download/v1.1.2.0/wingetcreate.exe -OutFile wingetcreate.exe
|
2022-08-17 15:50:11 +02:00
|
|
|
- name: ⬆️ Update winget manifest
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
WINGET_GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
2022-09-08 09:31:49 +02:00
|
|
|
if: "${{ env.WINGET_GITHUB_TOKEN != '' }}"
|
2022-08-17 15:50:11 +02:00
|
|
|
run: |
|
|
|
|
$tagname = $env:GITHUB_REF.Replace("refs/tags/", "")
|
|
|
|
$version = $tagname.Replace("v", "")
|
2023-01-12 08:25:28 +01:00
|
|
|
$url = "https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-Windows-x86_64.msi"
|
2022-08-17 15:50:11 +02:00
|
|
|
.\wingetcreate.exe update WerWolv.ImHex -u $url --version $version
|
|
|
|
if ($version -notmatch "-") {
|
|
|
|
.\wingetcreate.exe submit .\manifests\w\WerWolv\ImHex\${version}\ --token $env:WINGET_GITHUB_TOKEN
|
2022-08-17 22:32:55 +02:00
|
|
|
}
|