Skip to content

Commit

Permalink
Try fixing the release workflow
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
edomora97 committed Oct 14, 2021
1 parent d82ec8b commit 348d1ed
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ jobs:
run: |
set -ex
export version=$(grep version Cargo.toml | cut -d'"' -f 2)
sed -i "" "s/ARCHIVE_VERSION/v$version/g" ./tools/homebrew/task-maker-rust.rb
curl -L -o archive.tar.gz "https://github.com/edomora97/task-maker-rust/archive/v$version.tar.gz"
# the release may not have been published yet, use last commit instead
export version=$(git rev-parse HEAD)
sed -i "" "s/ARCHIVE_VERSION/$version/g" ./tools/homebrew/task-maker-rust.rb
curl -L -o archive.tar.gz "https://github.com/edomora97/task-maker-rust/archive/$version.tar.gz"
# export version=$(cargo pkgid task-maker-rust | cut -d'#' -f 2)
# sed -i "" "s/ARCHIVE_VERSION/v$version/g" ./tools/homebrew/task-maker-rust.rb
# curl -L -o archive.tar.gz "https://github.com/edomora97/task-maker-rust/archive/v$version.tar.gz"
export hash=$(shasum -a 256 archive.tar.gz | grep -o "[0-9a-f]*" | head -n 1)
sed -i "" "s/ARCHIVE_SHA256/$hash/g" ./tools/homebrew/task-maker-rust.rb
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: "target/debian/*.deb"
- name: Publish docker container
run: |
echo ${DOCKER_PASSWORD} | docker login --username edomora97 --password-stdin
export TM_VERSION=$(grep version Cargo.toml | cut -d'"' -f 2)
cd tools/docker
docker build --build-arg TM_VERSION=$TM_VERSION -t edomora97/task-maker-rust:latest -t edomora97/task-maker-rust:$TM_VERSION .
docker push edomora97/task-maker-rust:$TM_VERSION
docker push edomora97/task-maker-rust:latest
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
## For now do not build the docker container for the server/worker: it requires some fixes because the workers
## now spawn a single instance instead of as many as cores. Moreover, the server and worker commands changed.
# - name: Publish docker container
# run: |
# echo ${DOCKER_PASSWORD} | docker login --username edomora97 --password-stdin
# export TM_VERSION=$(grep version Cargo.toml | head -n 1 | cut -d'"' -f 2)
# cd tools/docker
# docker build --build-arg TM_VERSION=$TM_VERSION -t edomora97/task-maker-rust:latest -t edomora97/task-maker-rust:$TM_VERSION .
# docker push edomora97/task-maker-rust:$TM_VERSION
# docker push edomora97/task-maker-rust:latest
# env:
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

macOS:
name: Build & Publish (macOS)
Expand All @@ -39,7 +41,7 @@ jobs:
run: |
set -ex
export version=$(grep version Cargo.toml | cut -d'"' -f 2)
export version=$(grep version Cargo.toml | head -n 1 | cut -d'"' -f 2)
sed -i "" "s/ARCHIVE_VERSION/v$version/g" ./tools/homebrew/task-maker-rust.rb
curl -L -o archive.tar.gz "https://github.com/edomora97/task-maker-rust/archive/v$version.tar.gz"
export hash=$(shasum -a 256 archive.tar.gz | grep -o "[0-9a-f]*" | head -n 1)
Expand All @@ -53,7 +55,7 @@ jobs:
- name: Upload the artifacts
run: |
export filename=$(ls *.bottle.tar.gz)
export tag=v$(grep version Cargo.toml | cut -d'"' -f 2)
export tag=v$(grep version Cargo.toml | head -n 1 | cut -d'"' -f 2)
export GH_API="https://api.github.com"
export GH_REPO="$GH_API/repos/edomora97/task-maker-rust"
export GH_TAGS="$GH_REPO/releases/tags/$tag"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ There is a good chance that you have already all the dependencies already instal
For **ArchLinux** users you can find the packages in the AUR: [`task-maker-rust`](https://aur.archlinux.org/packages/task-maker-rust) (the stable release)
and [`task-maker-rust-git`](https://aur.archlinux.org/packages/task-maker-rust-git) (the version based on `master`).

For **MacOS Catalina** users you can find the pre-built bottle in the [Releases](https://github.com/edomora97/task-maker-rust/releases) page.
You can install it using `brew install task-maker-rust--*.catalina.bottle.tar.gz`.
For **MacOS** users you can find the pre-built bottle in the [Releases](https://github.com/edomora97/task-maker-rust/releases) page.
You can install it using `brew install task-maker-rust--*.bottle.tar.gz`.

For the other operating systems the recommended way to use task-maker-rust is the following:

Expand Down
1 change: 1 addition & 0 deletions tools/homebrew/task-maker-rust.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class TaskMakerRust < Formula
depends_on "rust" => :build

url "https://github.com/edomora97/task-maker-rust/archive/ARCHIVE_VERSION.tar.gz"
version "ARCHIVE_VERSION"
sha256 "ARCHIVE_SHA256"

def install
Expand Down

0 comments on commit 348d1ed

Please sign in to comment.