From c59b4f11cd2bf3028ec926c136771f274e50dfd6 Mon Sep 17 00:00:00 2001 From: Christoph Witzko <github@christophwitzko.com> Date: Tue, 27 Jul 2021 17:40:38 +0200 Subject: [PATCH] feat: add apple silicon support, closes #106 --- .github/workflows/ci.yml | 21 +++++++++++++-------- README.md | 25 ------------------------- docs/upgrade-from-v1-to-v2.md | 24 ++++++++++++++++++++++++ go.mod | 2 +- scripts/release | 6 ++---- 5 files changed, 40 insertions(+), 38 deletions(-) create mode 100644 docs/upgrade-from-v1-to-v2.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1535ea7..c173c98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: golangci-lint - run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s - ./bin/golangci-lint run -v + - uses: golangci/golangci-lint-action@v2 build: name: Build and Run @@ -29,7 +26,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.16 - uses: actions/checkout@v2 - run: go build ./cmd/semantic-release/ env: @@ -47,7 +44,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.16 - uses: actions/setup-node@v1 with: node-version: 10.x @@ -56,9 +53,17 @@ jobs: - run: | go get github.com/mitchellh/gox go get github.com/tcnksm/ghr + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/login-action@v1 + with: + registry: registry.gitlab.com + username: ${{ secrets.GITLAB_USER }} + password: ${{ secrets.GITLAB_TOKEN }} - run: ./scripts/release || exit 0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GITLAB_USER: ${{ secrets.GITLAB_USER }} - GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} diff --git a/README.md b/README.md index 4c8f7b1..3614f94 100644 --- a/README.md +++ b/README.md @@ -8,31 +8,6 @@ A more lightweight and standalone version of [semantic-release](https://github.com/semantic-release/semantic-release). -## 🚨 Upgrade to semantic-release v2 🚨 - -`semantic-release` v2 is now available. If you run into any problems, please create a [GitHub issue](https://github.com/go-semantic-release/semantic-release/issues/new). You can always downgrade to v1 with: - -``` -curl -SL https://get-release.xyz/semantic-release/linux/amd64/1.22.1 -o ./semantic-release && chmod +x ./semantic-release -``` - -### Breaking changes - -* It is now necessary to use **double dashes** for CLI flags (e.g. `--dry`) -* **Travis CI** support has been **removed** -* Some CLI flags have changed: - -| v1 | v2 | -|:--------------------------:|:------------------------------------------------:| -| `-vf` | `-f` | -| `--noci` | `--no-ci` | -| `--ghe-host <host>` | `--provider-opt "github_enterprise_host=<host>"` | -| `--travis-com` | _removed_ | -| `--gitlab` | `--provider gitlab` | -| `--gitlab-base-url <url>` | `--provider-opt "gitlab_baseurl=<url>"` | -| `--gitlab-project-id <id>` | `--provider-opt "gitlab_projectid=<id>"` | -| `--slug` | `--provider-opt "slug=<url>"` | - ## How does it work? Instead of writing [meaningless commit messages](http://whatthecommit.com/), we can take our time to think about the changes in the codebase and write them down. Following the [AngularJS Commit Message Conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit) it is then possible to generate a helpful changelog and to derive the next semantic version number from them. diff --git a/docs/upgrade-from-v1-to-v2.md b/docs/upgrade-from-v1-to-v2.md new file mode 100644 index 0000000..53b4378 --- /dev/null +++ b/docs/upgrade-from-v1-to-v2.md @@ -0,0 +1,24 @@ +## 🚨 Upgrade to semantic-release v2 🚨 + +`semantic-release` v2 is now available. If you run into any problems, please create a [GitHub issue](https://github.com/go-semantic-release/semantic-release/issues/new). You can always downgrade to v1 with: + +``` +curl -SL https://get-release.xyz/semantic-release/linux/amd64/1.22.1 -o ./semantic-release && chmod +x ./semantic-release +``` + +### Breaking changes + +* It is now necessary to use **double dashes** for CLI flags (e.g. `--dry`) +* **Travis CI** support has been **removed** +* Some CLI flags have changed: + +| v1 | v2 | +|:--------------------------:|:------------------------------------------------:| +| `-vf` | `-f` | +| `--noci` | `--no-ci` | +| `--ghe-host <host>` | `--provider-opt "github_enterprise_host=<host>"` | +| `--travis-com` | _removed_ | +| `--gitlab` | `--provider gitlab` | +| `--gitlab-base-url <url>` | `--provider-opt "gitlab_baseurl=<url>"` | +| `--gitlab-project-id <id>` | `--provider-opt "gitlab_projectid=<id>"` | +| `--slug` | `--provider-opt "slug=<url>"` | diff --git a/go.mod b/go.mod index ac0cb2a..1b6411d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/go-semantic-release/semantic-release/v2 -go 1.15 +go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.0 diff --git a/scripts/release b/scripts/release index 57dd347..43465be 100755 --- a/scripts/release +++ b/scripts/release @@ -6,13 +6,13 @@ set -euo pipefail export VERSION=$(cat .version) export CGO_ENABLED=0 -gox -parallel 4 -osarch="linux/amd64 darwin/amd64 linux/arm windows/amd64" -ldflags="-extldflags '-static' -s -w -X main.SRVERSION=$VERSION" -output="bin/{{.Dir}}_v"$VERSION"_{{.OS}}_{{.Arch}}" ./cmd/semantic-release/ +gox -parallel 4 -osarch="linux/amd64 darwin/amd64 darwin/arm64 linux/arm windows/amd64" -ldflags="-extldflags '-static' -s -w -X main.SRVERSION=$VERSION" -output="bin/{{.Dir}}_v"$VERSION"_{{.OS}}_{{.Arch}}" ./cmd/semantic-release/ cd bin/ && shasum -a 256 * > ./semantic-release_v${VERSION}_checksums.txt && cd - ghr $(cat .ghr) bin/ # docker build -export IMAGE_NAME="docker.pkg.github.com/go-semantic-release/semantic-release/semantic-release" +export IMAGE_NAME="ghcr.io/go-semantic-release/semantic-release" export IMAGE_NAME_VERSION="$IMAGE_NAME:$VERSION" export GL_IMAGE_NAME="registry.gitlab.com/go-semantic-release/semantic-release" export GL_IMAGE_NAME_VERSION="$GL_IMAGE_NAME:$VERSION" @@ -23,12 +23,10 @@ docker tag $IMAGE_NAME_VERSION $GL_IMAGE_NAME docker tag $IMAGE_NAME_VERSION $GL_IMAGE_NAME_VERSION # push to GitHub Docker Registry -docker login docker.pkg.github.com -u $GITHUB_ACTOR -p $GITHUB_TOKEN docker push $IMAGE_NAME_VERSION docker push $IMAGE_NAME # push to GitLab Docker Registry -docker login registry.gitlab.com -u $GITLAB_USER -p $GITLAB_TOKEN docker push $GL_IMAGE_NAME_VERSION docker push $GL_IMAGE_NAME -- GitLab