Skip to content

fix datasheet download as LCSC changed the view on their end #17

fix datasheet download as LCSC changed the view on their end

fix datasheet download as LCSC changed the view on their end #17

Workflow file for this run

'on':
push:
tags:
- 'v*'
jobs:
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
lfs: true
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: mkdir -p ./version
- run: git describe --tags "$(git rev-list --tags --max-count=1)" > ./version/version
- uses: actions/upload-artifact@master
with:
name: version
path: ./version/version
build:
needs:
- version
runs-on: '${{ matrix.os }}'
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
suffix: ''
- os: macos-14
target: aarch64-apple-darwin
suffix: ''
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
suffix: ''
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: .exe
steps:
- uses: actions/checkout@master
with:
lfs: true
- id: get_repository_name
run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/download-artifact@master
with:
name: version
- id: get_version
run: echo "VERSION=$(cat ./version/version)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@master
with:
path: ~/.cargo/registry
key: '${{ runner.os }}-cargo-registry-${{ hashFiles(''**/Cargo.lock'') }}'
- uses: actions/cache@master
with:
path: ~/.cargo/git
key: '${{ runner.os }}-cargo-index-${{ hashFiles(''**/Cargo.lock'') }}'
- uses: actions/cache@master
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
env:
VERSION: '${{ steps.get_version.outputs.VERSION }}'
REPOSITORY_NAME: '${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}'
with:
command: build
args: '--release'
- uses: actions/upload-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-${{ matrix.target }}
path: ./target/release/easyeda_to_kicad_lib_ui${{ matrix.suffix }}
release:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
lfs: true
- id: get_repository_name
run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/download-artifact@master
with:
name: version
- run: ls -lah
- id: get_version
run: 'echo "VERSION=$(cat ./version)" >> $GITHUB_OUTPUT'
shell: bash
- uses: actions/download-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu
path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu/
- uses: actions/download-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin
path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin/
- uses: actions/download-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin
path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin/
- uses: actions/download-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-pc-windows-msvc
path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-pc-windows-msvc/
- run: ls -lah
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
tag_name: '${{ steps.get_version.outputs.VERSION }}'
release_name: 'Release ${{ steps.get_version.outputs.VERSION }}'
draft: false
prerelease: false
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu/easyeda_to_kicad_lib_ui
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin/easyeda_to_kicad_lib_ui
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin/easyeda_to_kicad_lib_ui
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-pc-windows-msvc/easyeda_to_kicad_lib_ui.exe
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-pc-windows-msvc.exe
asset_content_type: application/octet-stream