-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release version 1.0.0 - "Ardent adenine"
Version 1.0.0 release PR - "Ardent adenine"
- Loading branch information
Showing
36 changed files
with
3,062 additions
and
614 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
35 changes: 18 additions & 17 deletions
35
.github/workflows/dockerhub.yml → .github/workflows/container.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,61 @@ | ||
name: Publish to Dockerhub | ||
name: Publish container images | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'releases/**' | ||
- AddCIpipelines | ||
tags: | ||
- 'v*' #if a push with a version tag like v0.0.2 is recorded | ||
- dev | ||
paths: | ||
- '**.rs' | ||
|
||
release: | ||
types: [published] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
push_to_registry: | ||
if: github.repository == 'SciLifeLab/umi-transfer' | ||
if: ( github.repository == 'SciLifeLab/umi-transfer' || github.repository == 'MatthiasZepper/umi-transfer') | ||
name: Push Docker image to Docker Hub / GitHub Docker Registry | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Change repo name to lowercase | ||
- name: Change repo name to lowercase and set environment variables | ||
run: | | ||
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | ||
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | ||
echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV} | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push dev image | ||
uses: docker/build-push-action@v2 | ||
uses: docker/build-push-action@v3 | ||
if: github.event_name == 'push' | ||
with: | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/umi-transfer:dev | ||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOTITLE_LOWERCASE }}:dev | ||
ghcr.io/${{ env.REPO_LOWERCASE }}:dev | ||
- name: Push release image | ||
uses: docker/build-push-action@v2 | ||
uses: docker/build-push-action@v3 | ||
if: github.event_name == 'release' | ||
with: | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/umi-transfer:${{ github.event.release.tag_name }} | ||
${{ secrets.DOCKERHUB_USERNAME }}/umi-transfer:latest | ||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOTITLE_LOWERCASE }}:${{ github.event.release.tag_name }} | ||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOTITLE_LOWERCASE }}:latest | ||
ghcr.io/${{ env.REPO_LOWERCASE }}:${{ github.event.release.tag_name }} | ||
ghcr.io/${{ env.REPO_LOWERCASE }}:${{ github.sha }} | ||
ghcr.io/${{ env.REPO_LOWERCASE }}:latest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
name: Build umi-transfer | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
workflow_dispatch: | ||
|
||
release: | ||
types: [published] | ||
|
||
jobs: | ||
# Thanks to Alex Hallam, from whose tidy-viewer release Action all compilation steps were copied (released under UNLICENSE terms) | ||
# https://github.com/alexhallam/tv | ||
# https://raw.githubusercontent.com/alexhallam/tv/main/.github/workflows/release.yml | ||
build_binaries: | ||
##if: github.repository == 'SciLifeLab/umi-transfer' | ||
name: Build binaries of the software | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
# For some builds, we use cross to test on 32-bit and big-endian | ||
# systems. | ||
CARGO: cargo | ||
# When CARGO is set to CROSS, this is set to `--target matrix.target`. | ||
TARGET_FLAGS: "" | ||
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target. | ||
TARGET_DIR: ./target | ||
# Emit backtraces on panics. | ||
RUST_BACKTRACE: 1 | ||
# Build static releases with PCRE2. | ||
PCRE2_SYS_STATIC: 1 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc] | ||
include: | ||
- build: linux | ||
os: ubuntu-latest | ||
rust: nightly | ||
target: x86_64-unknown-linux-gnu | ||
- build: linux | ||
os: ubuntu-latest | ||
rust: nightly | ||
target: x86_64-unknown-linux-musl | ||
- build: linux-arm | ||
os: ubuntu-latest | ||
rust: nightly | ||
target: arm-unknown-linux-gnueabihf | ||
- build: macos | ||
os: macOS-11 | ||
rust: nightly | ||
target: x86_64-apple-darwin | ||
- build: win-msvc | ||
os: windows-2019 | ||
rust: nightly | ||
target: x86_64-pc-windows-msvc | ||
- build: win-gnu | ||
os: ubuntu-latest | ||
rust: nightly-x86_64-gnu | ||
target: x86_64-pc-windows-gnu | ||
- build: win32-msvc | ||
os: windows-2019 | ||
rust: nightly | ||
target: i686-pc-windows-msvc | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set software version (release) | ||
if: github.event_name == 'release' | ||
run: | | ||
echo "SOFTWARE_VERSION=${{ github.event.release.tag_name }}" >> ${GITHUB_ENV} | ||
- name: Set software version (PR) | ||
if: matrix.os == 'ubuntu-latest' && (github.event_name == 'pull-request' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' ) | ||
run: | | ||
echo "SOFTWARE_VERSION=$(grep -Po -m 1 '(?<=version\s=\s\")[^\"]+' Cargo.toml)" >> ${GITHUB_ENV} | ||
- name: Install packages (Ubuntu) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends \ | ||
asciidoctor \ | ||
zsh xz-utils liblz4-tool musl-tools | ||
- name: Install packages (macOS) | ||
if: matrix.os == 'macOS-11' | ||
run: | | ||
brew install asciidoctor | ||
- name: Install Rust | ||
uses: ructions/toolchain@v2 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
profile: minimal | ||
override: true | ||
target: ${{ matrix.target }} | ||
|
||
- name: Use Cross | ||
shell: bash | ||
run: | | ||
cargo install cross | ||
echo "CARGO=cross" >> $GITHUB_ENV | ||
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV | ||
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV | ||
- name: Show command used for Cargo | ||
run: | | ||
echo "cargo command is: ${{ env.CARGO }}" | ||
echo "target flag is: ${{ env.TARGET_FLAGS }}" | ||
echo "target dir is: ${{ env.TARGET_DIR }}" | ||
- name: Build release binary | ||
run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }} | ||
|
||
- name: Strip release binary (linux and macos) | ||
if: matrix.build == 'linux' || matrix.build == 'macos' | ||
run: strip "target/${{ matrix.target }}/release/umi-transfer" | ||
|
||
# For now revert to the old image, since the new image does not regognise the format of the compiled binary. | ||
#- name: Strip release binary (arm) | ||
# if: matrix.build == 'linux-arm' | ||
# run: | | ||
# docker run --rm -v \ | ||
# "$PWD/target:/target:Z" \ | ||
# ghcr.io/cross-rs/arm-unknown-linux-gnueabihf:edge \ | ||
# strip /target/arm-unknown-linux-gnueabihf/release/umi-transfer | ||
|
||
- name: Strip release binary (arm) | ||
if: matrix.build == 'linux-arm' | ||
run: | | ||
docker run --rm -v \ | ||
"$PWD/target:/target:Z" \ | ||
rustembedded/cross:arm-unknown-linux-gnueabihf \ | ||
arm-linux-gnueabihf-strip \ | ||
/target/arm-unknown-linux-gnueabihf/release/umi-transfer | ||
- name: Build archive | ||
shell: bash | ||
run: | | ||
staging="umi-transfer-${{ env.SOFTWARE_VERSION }}-${{ matrix.target }}" | ||
mkdir "$staging" | ||
cp {README.md,LICENSE} "$staging/" | ||
cp -R docs "$staging/docs" | ||
if [ "${{ matrix.target }}" = "i686-pc-windows-msvc" ] || [ "${{ matrix.target }}" = "x86_64-pc-windows-gnu" ] || [ "${{ matrix.target }}" = "x86_64-pc-windows-msvc" ]; then | ||
echo "Target is Windows Based" | ||
cp "target/${{ matrix.target }}/release/umi-transfer.exe" "$staging/" | ||
7z a "$staging.zip" "$staging" | ||
echo "ASSET=$staging.zip" >> $GITHUB_ENV | ||
else | ||
echo "Target is not Windows Based" | ||
cp "target/${{ matrix.target }}/release/umi-transfer" "$staging/" | ||
tar czf "$staging.tar.gz" "$staging" | ||
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV | ||
fi | ||
- name: Create artifact from binary | ||
if: (github.event_name == 'push' || github.event_name == 'pull-request' || github.event_name == 'workflow_dispatch' ) && github.event.ref == 'refs/heads/main' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.ASSET }} | ||
path: ${{ env.ASSET }} | ||
|
||
- name: Upload release archive | ||
uses: actions/[email protected] | ||
if: github.event_name == 'release' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ env.ASSET }} | ||
asset_name: ${{ env.ASSET }} | ||
asset_content_type: application/octet-stream |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.