diff --git a/.github/workflows/docker-multiarch-tag.yml b/.github/workflows/multiarch-build.yml similarity index 69% rename from .github/workflows/docker-multiarch-tag.yml rename to .github/workflows/multiarch-build.yml index d3ac9d14..c0028ae8 100644 --- a/.github/workflows/docker-multiarch-tag.yml +++ b/.github/workflows/multiarch-build.yml @@ -1,50 +1,25 @@ -name: Release +name: Build Release on: push: - branches: - - master + tags: + - v* jobs: - tag: - name: Tag release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: mathieudutour/github-tag-action@v4.5 - id: tag_version - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - tag_prefix: "v" - create_annotated_tag: true - - name: share variables - shell: bash - run: | - mkdir env - echo ${{ steps.tag_version.outputs.new_version }} > env/new_version - echo ${{ steps.tag_version.outputs.new_tag }} > env/new_tag - echo "${{ steps.tag_version.outputs.changelog }}" > env/changelog - - uses: actions/upload-artifact@v1 - with: - name: env - path: env build-releases: strategy: matrix: arch: ["x86_64", "armv7h", "aarch64"] name: Build ${{ matrix.arch }} runs-on: ubuntu-latest - needs: [tag] steps: - name: Checkout code uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 - with: - name: env - name: Read info id: tags shell: bash run: | - echo ::set-output name=VERSION::$(cat new_version) + echo ::set-output name=VERSION::${GITHUB_REF#/refs/tags/v} + echo ::set-output name=TAG::${GITHUB_REF#/refs/tags/} - name: Install dependencies run: sudo apt update -y && sudo apt install -y qemu qemu-user-static - name: Setup qemu-user-static @@ -54,7 +29,7 @@ jobs: mkdir artifacts make docker-release-${{ matrix.arch }} ARCH=${{ matrix.arch }} VERSION=${{ steps.tags.outputs.version }} mv *.tar.gz artifacts - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v2 with: name: yay_${{ matrix.arch }} path: artifacts @@ -63,18 +38,17 @@ jobs: needs: [build-releases] runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 - with: - name: env - name: Read info id: tags shell: bash run: | - echo ::set-output name=VERSION::$(cat new_version) - echo ::set-output name=TAG::$(cat new_tag) - echo ::set-output name=CHANGELOG::$(cat changelog) + echo ::set-output name=VERSION::${GITHUB_REF#/refs/tags/v} + echo ::set-output name=TAG::${GITHUB_REF#/refs/tags/} + - name: Changelog + uses: scottbrenner/generate-changelog-action@master + id: changelog + env: + REPO: ${{ github.repository }} - uses: actions/download-artifact@v2 with: name: yay_x86_64 @@ -92,7 +66,8 @@ jobs: with: tag_name: ${{ steps.tags.outputs.tag }} release_name: ${{ steps.tags.outputs.tag }} - body: ${{ steps.tags.outputs.changelog }} + body: | + ${{ steps.changelog.outputs.changelog }} draft: false prerelease: false - name: Upload x86_64 asset diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 00000000..e9f27500 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,17 @@ +name: Tag +on: + push: + branches: + - master + +jobs: + tag: + name: Tag release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: mathieudutour/github-tag-action@v4.5 + id: tag_version + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tag_prefix: "v" diff --git a/.github/workflows/docker-ci.yml b/.github/workflows/testing.yml similarity index 89% rename from .github/workflows/docker-ci.yml rename to .github/workflows/testing.yml index 30d1b28a..37fe4741 100644 --- a/.github/workflows/docker-ci.yml +++ b/.github/workflows/testing.yml @@ -6,6 +6,8 @@ on: - "doc/**" - "README.md" - ".gitignore" + branches-ignore: + - "master" pull_request: jobs: @@ -26,6 +28,6 @@ jobs: - name: Run Build and tests run: | pacman -Sy --noconfirm go - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.26.0 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.27.0 ./bin/golangci-lint run ./... make test diff --git a/Makefile b/Makefile index c947965e..19e423de 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,7 @@ $(BIN): $(SOURCES) $(RELEASE_DIR): mkdir $(RELEASE_DIR) -$(PACKAGE): $(BIN) $(RELEASE_DIR) +$(PACKAGE): $(BIN) $(RELEASE_DIR) ${MOFILES} cp -t $(RELEASE_DIR) ${BIN} doc/${PKGNAME}.8 completions/* ${MOFILES} tar -czvf $(PACKAGE) $(RELEASE_DIR)