fixed credentials #112
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 binary artifacts | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo | |
- name: Install latest rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
override: true | |
- name: Run linter FOSS | |
run: cargo clippy | |
- name: Run linter commercial | |
env: | |
WORTERBUCH_LICENSE_SECRET: ${{ secrets.WORTERBUCH_LICENSE_SECRET }} | |
run: cargo clippy --features=commercial | |
- name: Run tests FOSS | |
run: cargo test | |
- name: Run tests commercial | |
env: | |
WORTERBUCH_LICENSE_SECRET: ${{ secrets.WORTERBUCH_TEST_LICENSE_SECRET }} | |
WORTERBUCH_LICENSE_FILE: ./test/license | |
run: cargo test --features=commercial | |
publish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo | |
- name: Install latest rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
override: true | |
- name: Publish to crates.io | |
run: ./publish.sh | |
env: | |
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} | |
docker: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
babymotte/worterbuch | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: "lab:latest" | |
driver: cloud | |
endpoint: "babymotte/default" | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# For pull requests, export results to the build cache. | |
# Otherwise, push to a registry. | |
outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} | |
docker-cli: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
babymotte/worterbuch-cli | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: "lab:latest" | |
driver: cloud | |
endpoint: "babymotte/default" | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# For pull requests, export results to the build cache. | |
# Otherwise, push to a registry. | |
outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} | |
release: | |
needs: test | |
runs-on: ${{ matrix.image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
image: ubuntu-latest | |
ext: "" | |
- target: x86_64-pc-windows-msvc | |
image: windows-latest | |
ext: ".exe" | |
- target: x86_64-apple-darwin | |
image: macos-latest | |
ext: "" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo | |
- name: Install latest rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
override: true | |
- name: Build | |
run: cargo build --release | |
- name: Package Binaries | |
uses: vimtor/action-zip@v1 | |
with: | |
files: target/release/worterbuch${{ matrix.ext }} target/release/wbdel${{ matrix.ext }} target/release/wbget${{ matrix.ext }} target/release/wbjson${{ matrix.ext }} target/release/wbls${{ matrix.ext }} target/release/wblssub${{ matrix.ext }} target/release/wbpdel${{ matrix.ext }} target/release/wbpget${{ matrix.ext }} target/release/wbpls${{ matrix.ext }} target/release/wbpsub${{ matrix.ext }} target/release/wbpub${{ matrix.ext }} target/release/wbpubs${{ matrix.ext }} target/release/wbset${{ matrix.ext }} target/release/wbsets${{ matrix.ext }} target/release/wbsub${{ matrix.ext }} | |
dest: worterbuch-${{ matrix.target }}.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: worterbuch-${{ matrix.target }}.zip |