Release v0.2.0 #11
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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
RUST_BACKTRACE: full | |
jobs: | |
release: | |
name: Create release | |
permissions: write-all | |
runs-on: ubuntu-latest | |
outputs: | |
release_upload_url: ${{ steps.create_release.outputs.upload_url }} | |
release_version: ${{ steps.get_version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get release version | |
id: get_version | |
uses: battila7/get-version-action@v2 | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_version.outputs.version }} | |
release_name: Release ${{ steps.get_version.outputs.version }} | |
draft: true | |
prerelease: false | |
build-unix: | |
name: Build ${{ matrix.job.os }} (${{ matrix.job.target }}) | |
permissions: write-all | |
runs-on: ${{ matrix.job.os }} | |
needs: release | |
env: | |
TINYTUN_DEFAULT_SERVER_URL: https://tinytun.com:5554 | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- { os: ubuntu-latest, target: i686-unknown-linux-gnu, use-cross: true } | |
- { os: ubuntu-latest, target: i686-unknown-linux-musl, use-cross: true } | |
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl, use-cross: true } | |
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu } | |
- { os: macos-latest, target: x86_64-apple-darwin } | |
- { os: macos-latest, target: aarch64-apple-darwin } | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: ${{ matrix.job.target }} | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: ${{ matrix.job.use-cross }} | |
command: build | |
args: --release --locked --package tinytun-client --target=${{ matrix.job.target }} | |
- name: Strip debug information | |
run: strip target/${{ matrix.job.target }}/release/tinytun-client | |
- run: mv target/${{ matrix.job.target }}/release/tinytun-client target/${{ matrix.job.target }}/release/tinytun | |
- name: Archive | |
run: tar czf tinytun-${{ needs.release.outputs.release_version }}-${{ matrix.job.target }}.tar.gz -C target/${{ matrix.job.target }}/release tinytun | |
- name: Upload release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.release_upload_url }} | |
asset_path: tinytun-${{ needs.release.outputs.release_version }}-${{ matrix.job.target }}.tar.gz | |
asset_name: tinytun-${{ needs.release.outputs.release_version }}-${{ matrix.job.target }}.tar.gz | |
asset_content_type: application/octet-stream | |
build-win: | |
name: Build Windows (${{ matrix.job.target }}) | |
permissions: write-all | |
runs-on: windows-latest | |
needs: release | |
env: | |
TINYTUN_DEFAULT_SERVER_URL: https://tinytun.com:5554 | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- { os: windows-latest, target: i686-pc-windows-msvc } | |
- { os: windows-latest, target: x86_64-pc-windows-gnu } | |
- { os: windows-latest, target: x86_64-pc-windows-msvc } | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: ${{ matrix.job.target }} | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --locked --package tinytun-client --target=${{ matrix.job.target }} | |
- run: mv target/${{ matrix.job.target }}/release/tinytun-client.exe target/${{ matrix.job.target }}/release/tinytun.exe | |
- name: Archive | |
run: 7z -y a tinytun-${{ needs.release.outputs.release_version }}-${{ matrix.job.target }}.exe.zip target/${{ matrix.job.target }}/release/tinytun.exe | |
- name: Upload release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.release_upload_url }} | |
asset_path: tinytun-${{ needs.release.outputs.release_version }}-${{ matrix.job.target }}.exe.zip | |
asset_name: tinytun-${{ needs.release.outputs.release_version }}-${{ matrix.job.target }}.exe.zip | |
asset_content_type: application/zip |