implement dirty workaround for new alt:V behavior #17
Workflow file for this run
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: Stable release (alt:V release branch) | |
on: | |
push: | |
tags: | |
- 'release-v*' | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: rust version | |
run: rustc -V | |
- name: auth | |
run: | | |
git config --global user.name "release" | |
git config --global user.email "[email protected]" | |
- 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/[email protected] | |
- 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 '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 }} --exclude cargo-altvup --no-confirm --execute | |
- 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 | |
- uses: ncipollo/release-action@v1 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: upload archive | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
asset_name: source.tar.gz | |
file: source.tar.gz | |
tag: ${{ github.ref }} | |
overwrite: true |