release v0.2 (#34) #5
Workflow file for this run
This file contains hidden or 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: | |
| - '*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish_crates: | |
| name: Release Libraries | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| if: github.ref_type == 'tag' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install stable | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libudev-dev | |
| - name: Publish | |
| env: | |
| TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | |
| run: | | |
| cargo login $TOKEN | |
| cargo publish | |
| build: | |
| name: build | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: true | |
| env: | |
| CARGO: cargo | |
| RUST_BACKTRACE: 1 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - build: linux | |
| os: ubuntu-latest | |
| rust: stable | |
| target: x86_64-unknown-linux-gnu | |
| - build: macos | |
| os: macos-latest | |
| rust: stable | |
| target: x86_64-apple-darwin | |
| - build: macos | |
| os: macos-latest | |
| rust: stable | |
| target: aarch64-apple-darwin | |
| - build: win64-msvc | |
| os: windows-latest | |
| rust: stable | |
| target: x86_64-pc-windows-msvc | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| target: ${{ matrix.target }} | |
| - name: Update | |
| if: matrix.build == 'linux' | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libudev-dev | |
| - name: Build applications | |
| shell: bash | |
| run: | | |
| CARGO_PROFILE_RELEASE_STRIP=symbols ${{ env.CARGO }} build \ | |
| --verbose \ | |
| --target ${{ matrix.target }} \ | |
| --all-features \ | |
| --release | |
| ls -lah target/${{ matrix.target }}/release | |
| if [ "${{ matrix.os }}" = "windows-latest" ]; then | |
| ubx2rinex="target/${{ matrix.target }}/release/ubx2rinex.exe" | |
| else | |
| ubx2rinex="target/${{ matrix.target }}/release/ubx2rinex" | |
| fi | |
| echo "UBX2RINEX=$ubx2rinex" >> $GITHUB_ENV | |
| - name: Determine archive name | |
| shell: bash | |
| run: | | |
| echo "ARCHIVE=ubx2rinex-${{ github.ref_name }}-${{ matrix.target }}" >> $GITHUB_ENV | |
| - name: Creating directory for archive | |
| shell: bash | |
| run: | | |
| mkdir -p "$ARCHIVE" | |
| cp {README.md,LICENSE} "$ARCHIVE"/ | |
| cp "$UBX2RINEX" "$ARCHIVE" | |
| - name: Gzip archive (Unix) | |
| shell: bash | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| tar czf "$ARCHIVE.tar.gz" "$ARCHIVE" | |
| shasum -a 256 "$ARCHIVE.tar.gz" > "$ARCHIVE.tar.gz.sha256" | |
| echo "ASSET=$ARCHIVE.tar.gz" >> $GITHUB_ENV | |
| echo "ASSET_SUM=$ARCHIVE.tar.gz.sha256" >> $GITHUB_ENV | |
| - name: Zip archive (Windows) | |
| shell: bash | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| 7z a "$ARCHIVE.zip" "$ARCHIVE" | |
| certutil -hashfile "$ARCHIVE.zip" SHA256 > "$ARCHIVE.zip.sha256" | |
| echo "ASSET=$ARCHIVE.zip" >> $GITHUB_ENV | |
| echo "ASSET_SUM=$ARCHIVE.zip.sha256" >> $GITHUB_ENV | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.ASSET }} | |
| path: | | |
| ${{ env.ASSET }} | |
| - name: Upload artifacts (cksum) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.ASSET_SUM }} | |
| path: | | |
| ${{ env.ASSET_SUM }} | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: ['build'] | |
| # continue even though we failed to download or upload one | |
| # or more artefacts | |
| continue-on-error: true | |
| steps: | |
| - name: Create Release | |
| id: create_release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| uses: actions/create-release@v1 | |
| with: | |
| draft: true | |
| tag_name: ${{ github.ref_name }} | |
| release_name: ${{ github.ref_name }} | |
| - name: Download x86_64-unknown-linux-gnu | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ubx2rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz | |
| - name: Download x86_64-unknown-linux-gnu (cksum) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ubx2rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz.sha256 | |
| - name: Upload x86_64-unknown-linux-gnu | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ubx2rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz | |
| asset_name: ubx2rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz | |
| asset_content_type: application/gzip | |
| - name: Upload x86_64-unknown-linux-gnu (cksum) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ubx2rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz.sha256 | |
| asset_name: ubx2rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz.sha256 | |
| asset_content_type: application/gzip | |
| - name: Download x86_64-apple-darwin | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ubx2rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz | |
| - name: Download x86_64-apple-darwin (cksum) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ubx2rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz.sha256 | |
| - name: Upload x86_64-apple-darwin | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ubx2rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz | |
| asset_name: ubx2rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz | |
| asset_content_type: application/gzip | |
| - name: Upload x86_64-apple-darwin (cksum) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ubx2rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz.sha256 | |
| asset_name: ubx2rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz.sha256 | |
| asset_content_type: application/gzip | |
| - name: Download aarch64-apple-darwin | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ubx2rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz | |
| - name: Download aarch64-apple-darwin (cksum) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ubx2rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz.sha256 | |
| - name: Upload aarch64-apple-darwin | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ubx2rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz | |
| asset_name: ubx2rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz | |
| asset_content_type: application/gzip | |
| - name: Upload aarch64-apple-darwin (cksum) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ubx2rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz.sha256 | |
| asset_name: ubx2rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz.sha256 | |
| asset_content_type: application/gzip | |
| - name: Download x86_64-pc-windows-msvc | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ubx2rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip | |
| - name: Download x86_64-pc-windows-msvc (cksum) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ubx2rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip.sha256 | |
| - name: Upload x86_64-pc-windows-msvc | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ubx2rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip | |
| asset_name: ubx2rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip | |
| asset_content_type: application/zip | |
| - name: Upload x86_64-pc-windows-msvc (cksum) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ubx2rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip.sha256 | |
| asset_name: ubx2rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip.sha256 | |
| asset_content_type: application/zip |