Update feature-request.yml #350
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "Version" | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
update-version: | |
name: ✏️ Update Version | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: ⤵️ Check out code from GitHub | |
uses: actions/[email protected] | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.PUSH_TOKEN }} | |
- name: 🖊️ Create draft release | |
id: release-drafter | |
uses: release-drafter/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: ✏ Set Version Files | |
run: | | |
echo "Version: ${{ steps.release-drafter.outputs.tag_name }}" | |
sudo apt update | |
sudo apt install -y jq | |
# Update version in package.json | |
jq --arg version ${{ steps.release-drafter.outputs.tag_name }} '.version = $version' package.json > package.json.tmp && \ | |
mv package.json.tmp package.json | |
# Update version in src-tauri/tauri.conf.json | |
jq --arg version ${{ steps.release-drafter.outputs.tag_name }} '.version = $version' src-tauri/tauri.conf.json > src-tauri/tauri.conf.json.tmp && \ | |
mv src-tauri/tauri.conf.json.tmp src-tauri/tauri.conf.json | |
# Update version in src-tauri/Cargo.toml | |
sed -i '0,/version/s/^version = "\([0-9.]*\)"$/version = "${{ steps.release-drafter.outputs.tag_name }}"/' src-tauri/Cargo.toml | |
- name: ⤵️ Pull latest changes from GitHub | |
run: | | |
git pull --ff | |
- name: 🖊 Commit | |
uses: stefanzweifel/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }} | |
with: | |
commit_message: | | |
Update version to ${{ steps.release-drafter.outputs.tag_name }} | |
push_options: "--force" |