Skip to content

fix

fix #12

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
paths-ignore:
- 'README.md'
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.x'
- run: npm i -g openblock-resource@latest
- name: Pre-process resources
run: |
gen-config --version=${{ github.ref_name }}
- name: Get version
id: get-version
run: |
version=`echo ${{ github.ref_name }} | sed -r 's/[v]+//g'`
echo ::set-output name=VERSION::$version
- name: Clear Unused files
run: |
rm -r .git .github buildResources
- name: Zip resources
uses: vimtor/action-zip@v1
with:
files: ./
dest: external-resources-${{ steps.get-version.outputs.VERSION }}.zip
- name: Checksum
run: sha256sum external-resources-*.zip >> ${{ steps.get-version.outputs.VERSION }}-checksums-sha256.txt
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: OpenBlock External Resources ${{ github.ref_name }}
body: |
## Change Log (en)
- **New feature**
1. Feature 1.
2. Feature 2.
- **Fix bug**
1. Bug 1.
2. Bug 2.
## 更改日志 (zh-cn)
- **新功能**
1. 功能1。
2. 功能2。
- **修复错误**
1. 错误1。
2. 错误2。
draft: true
prerelease: false
# Upload zip
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: external-resources-${{ steps.get-version.outputs.VERSION }}.zip
asset_name: external-resources-${{ steps.get-version.outputs.VERSION }}.zip
asset_content_type: application/zip
# Upload checksum
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.get-version.outputs.VERSION }}-checksums-sha256.txt
asset_name: ${{ steps.get-version.outputs.VERSION }}-checksums-sha256.txt
asset_content_type: text/plain
build-windows:
needs: create-release
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Install Inno Setup
shell: powershell
run: |
choco install innosetup
- name: Get version
id: get-version
run: |
$tag = "${{ github.ref_name }}"
$version = $tag.Substring(1)
Write-Output "::set-output name=VERSION::$version"
- name: Build Installer
shell: powershell
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /dVersion="${{ steps.get-version.outputs.VERSION }}" "./buildResources/setup.iss"
- name: Upload to Release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "./dist/OpenBlock-External-Resources*"
update_latest_release: true
build-mac:
needs: create-release
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Get version
id: get-version
run: |
version=`echo ${{ github.ref_name }} | sed -r 's/[v]+//g'`
echo ::set-output name=VERSION::$version
- name: Build Installer
run: ./buildResources/build-pkg.sh VERSION="${{ steps.get-version.outputs.VERSION }}"
- name: Upload to Release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "./dist/OpenBlock-External-Resources*"
update_latest_release: true
build-linux:
needs: create-release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Get version
id: get-version
run: |
version=`echo ${{ github.ref_name }} | sed -r 's/[v]+//g'`
echo ::set-output name=VERSION::$version
- name: Build Installer
run: ./buildResources/build-deb.sh -v"${{ steps.get-version.outputs.VERSION }}"
- name: Upload to Release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "./dist/OpenBlock-External-Resources*"
update_latest_release: true