Skip to content

Commit

Permalink
altvup (#35)
Browse files Browse the repository at this point in the history
* update rust version

* use 2 spaces in Cargo.toml as well

* add test release

* add test release

* test release

* test release

* test release

* seems like reqwest does not support other async runtimes :deadge:

* WIP

* update tabSize

* seems like it works

* readme WIP

* improve release check in test action

* add support for cargo-binstall

* fix asset names

* altvup 0.3.0

* finish altvup readme

* improve error output

* altvup 0.3.1

* improve handling of invalid branch

* add windows to altvup_release

* altvup 0.3.2

* fix windows binary archive

* fix asset name

* update description

* release new version: 16.2.3-test.0

* improve source code release CI

* remove unneeded step

* add missing release_name

* lets try this then

* add test-release branch in debug mode

* add `--rust-module-releases-pages`

* test

* test

* test

* test

* add --allow-branch

* try to to set it in Cargo.toml

* remove it from here

* test

* extract branch

* does it work?

* oops

* release new version: 16.2.3-test.14

* and now, hopefully final test

* release new version: 16.2.3-test.15

* remove allow-branch

* add cargo-release to altvup-release

* release new version: {{version}}

* add cargo-release settings for altvup

* pin cargo-release version

* release new version: {{version}}

* remove cargo-release settings from altvup

* add workaround

* forgot

* release altvup 0.3.4

* add --voice-server

* release altvup 0.3.5

* add rust-toolchain.toml

* update releases CI

* update readme

* use 2 spaces

* new icon 🦀

* add logo to docs

* update sdk

* turns out extension is not needed

* add --dont-compile

* --dont-compile impl

* refactor test runner

---------

Co-authored-by: release <release@release.release>
  • Loading branch information
xxshady and release authored Nov 20, 2024
1 parent f4bfb67 commit caf2f34
Show file tree
Hide file tree
Showing 33 changed files with 1,345 additions and 1,429 deletions.
1 change: 1 addition & 0 deletions .cspell/custom-dictionary-workspace.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-DALT_SERVER_API
# Custom Dictionary Words
altv
altvup
ColShapy
cxxbridge
dlopen
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/altvup_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: altvup-release

on:
push:
tags:
- 'altvup-release-v*'

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
binary: cargo-altvup
- target: x86_64-pc-windows-msvc
os: windows-latest
binary: cargo-altvup.exe

steps:
- name: checkout
uses: actions/checkout@v3

- name: build
run: |
cd altvup
cargo build --release
- name: archive
run: |
cd target/release
tar -czvf ${{ matrix.target }}.tgz ${{ matrix.binary }}
cp ${{ matrix.target }}.tgz ../../
- name: upload archive
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
asset_name: ${{ matrix.target }}.tgz
file: ${{ matrix.target }}.tgz
tag: ${{ github.ref }}
overwrite: true

github-release:
runs-on: ubuntu-22.04
steps:
- uses: ncipollo/release-action@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

cargo-release:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: auth
run: |
git config --global user.name "release"
git config --global user.email "release@release.release"
- name: extract branch from tag
id: extract_branch
run: |
BRANCH=$( git log -1 --format='%D' ${{ github.ref_name }} | grep -oP 'origin/\K.*' )
echo "BRANCH=$BRANCH" >> $GITHUB_OUTPUT
- name: print branch
run: echo ${{ steps.extract_branch.outputs.BRANCH }}

- name: switch to branch
run: git switch ${{ steps.extract_branch.outputs.BRANCH }}

- name: cargo login
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}

- name: install cargo-binstall
uses: cargo-bins/cargo-binstall@v1.10.12

- name: install cargo-release
run: |
cargo binstall cargo-release@=0.25.13 --no-confirm
- name: extract version from tag
id: extract_version
run: |
VERSION=$( echo ${{ github.ref_name }} | grep -oP 'altvup-release-v\K.*' )
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: print version
run: echo ${{ steps.extract_version.outputs.VERSION }}

- name: cargo release
run: |
cargo release ${{ steps.extract_version.outputs.VERSION }} --package cargo-altvup --no-push --no-tag --no-confirm --execute
- name: commit message workaround
run: |
git reset HEAD~1
git add .
git commit -m "release altvup ${{ steps.extract_version.outputs.VERSION }}"
git push
104 changes: 0 additions & 104 deletions .github/workflows/dev_release.yml

This file was deleted.

121 changes: 50 additions & 71 deletions .github/workflows/rc_release.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,78 @@
name: Rc release
name: Rc release (alt:V rc branch)

on:
push:
tags:
- 'rc-v*'

jobs:
build-linux:
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Install latest stable rust
run: rustup update

# TODO: cache
- name: rust version
run: rustc -V

- name: Build
- name: auth
run: |
cd altv_module
cargo build --release
git config --global user.name "release"
git config --global user.email "release@release.release"
- uses: actions/upload-artifact@v3
name: Upload module-linux
with:
name: module-linux
path: target/release/libaltv_module.so
- name: extract branch from tag
id: extract_branch
run: |
BRANCH=$( git log -1 --format='%D' ${{ github.ref_name }} | grep -oP 'origin/\K.*' )
echo "BRANCH=$BRANCH" >> $GITHUB_OUTPUT
- name: print branch
run: echo ${{ steps.extract_branch.outputs.BRANCH }}

- name: switch to branch
run: git switch ${{ steps.extract_branch.outputs.BRANCH }}

build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: cargo login
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}

- name: Install latest stable rust
run: rustup update
- name: install cargo-binstall
uses: cargo-bins/cargo-binstall@v1.10.12

# TODO: cache
- name: install cargo-release
run: |
cargo binstall cargo-release@=0.25.13 --no-confirm
- name: extract version from tag
id: extract_version
run: |
VERSION=$( echo ${{ github.ref_name }} | grep -oP 'rc-v\K.*' )
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: print version
run: echo ${{ steps.extract_version.outputs.VERSION }}

- name: Build
- name: cargo release
run: |
cd altv_module
cargo build --release
cargo release ${{ steps.extract_version.outputs.VERSION }} --exclude cargo-altvup --no-confirm --execute
- uses: actions/upload-artifact@v3
name: Upload module-windows
with:
name: module-windows
path: target/release/altv_module.dll
- name: create archive
# seems like --exclude-from doesnt support all syntax of gitignore but it doesnt really matter
run: |
cd ..
tar --exclude-caches --exclude-vcs --exclude-from=./altv-rust/.gitignore --exclude=*.bat --exclude *.sh --directory ./altv-rust -czvf source.tar.gz .
cp source.tar.gz ./altv-rust/source.tar.gz
release:
runs-on: ubuntu-22.04
needs: [
build-linux,
build-windows
]
steps:
- uses: ncipollo/release-action@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: upload archive
uses: svenstaro/upload-release-action@v2
with:
prerelease: true

- uses: actions/download-artifact@v4
name: Download module-linux artifact
with:
name: module-linux

- uses: shogo82148/actions-upload-release-asset@v1
name: Upload module-linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./libaltv_module.so
asset_name: librust-module.so
asset_content_type: application/octet-stream

- uses: actions/download-artifact@v4
name: Download module-windows artifact
with:
name: module-windows

- uses: shogo82148/actions-upload-release-asset@v1
name: Upload module-windows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./altv_module.dll
asset_name: rust-module.dll
asset_content_type: application/octet-stream
repo_token: ${{ secrets.GITHUB_TOKEN }}
asset_name: source.tar.gz
file: source.tar.gz
tag: ${{ github.ref }}
overwrite: true
Loading

0 comments on commit caf2f34

Please sign in to comment.